Skip to content

Commit

Permalink
Fixed sdscat*() bug: read memory error
Browse files Browse the repository at this point in the history
  • Loading branch information
iiol committed Jul 6, 2020
1 parent 78df725 commit 8da2034
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sds.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ sds sdscatlen(sds s, const void *t, size_t len) {

s = sdsMakeRoomFor(s,len);
if (s == NULL) return NULL;
memcpy(s+curlen, t, len);
memmove(s+curlen, t, len);
sdssetlen(s, curlen+len);
s[curlen+len] = '\0';
return s;
Expand Down

0 comments on commit 8da2034

Please sign in to comment.