Description: Use memmove instead of memcpy for overlapping src/dst Author: Yann Dirson Bug-Debian: http://bugs.debian.org/753516 --- libj/jstr/str_trim.c.orig +++ libj/jstr/str_trim.c @@ -47,7 +47,7 @@ char *trim(char *s) { SET_LAST_NWS(ws, s); /* Copy the non-ws characters in . */ - if(ws.fnws > d) MEMCPY(d, ws.fnws, NWS_SIZE(ws)); + if(ws.fnws > d) MEMMOVE(d, ws.fnws, NWS_SIZE(ws)); *(d + NWS_SIZE(ws)) = '\0'; return(d); @@ -93,7 +93,7 @@ char *ltrim(char *s) { if(s != NULL) { SKIM_WHITESPACE(s); - MEMCPY(d, s, STRLEN(s) + 1); + MEMMOVE(d, s, STRLEN(s) + 1); return(d); } return(NULL);