Skip to content

Commit

Permalink
fix(deps): 'strcpy' writing one too many bytes
Browse files Browse the repository at this point in the history
into a region of a size that depends on 'strlen'.

Signed-off-by: Julian Strobl <[email protected]>
  • Loading branch information
jmastr committed Jan 4, 2025
1 parent d525c26 commit 6396474
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mem/libxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ unsigned long alloc_count = 0;

#ifndef strdup
char *strdup (const char *str) {
char *new = malloc(strlen(str));
char *new = malloc(strlen(str) + 1);
strcpy(new, str);
return new;
}
Expand Down

0 comments on commit 6396474

Please sign in to comment.