Skip to content

Commit

Permalink
kernel: fix string copying logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rbehrends authored and fingolfin committed Jan 8, 2019
1 parent 6d46c38 commit 872d493
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stringobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,8 @@ Obj CopyToStringRep(
copy = NEW_STRING(lenString);

if ( IS_STRING_REP(string) ) {
memcpy(ADDR_OBJ(copy), CONST_ADDR_OBJ(string), SIZE_OBJ(string));
memcpy(CHARS_STRING(copy), CONST_CHARS_STRING(string),
GET_LEN_STRING(string));
/* XXX no error checks? */
} else {
/* copy the string to the string representation */
Expand Down

0 comments on commit 872d493

Please sign in to comment.