Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Do not copy more bytes than were allocated
- Loading branch information
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -777,8 +777,9 @@ void xmlrpc_char_encode(char *outbuffer, const char *s1) | |
| s->append_char(s, c); | ||
| } | ||
| } | ||
| s->append_char(s, 0); | ||
|
|
||
| memcpy(outbuffer, s->str, XMLRPC_BUFSIZE); | ||
| strncpy(outbuffer, s->str, XMLRPC_BUFSIZE); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kaniini
Contributor
|
||
| } | ||
|
|
||
| static void xmlrpc_append_char_encode(mowgli_string_t *s, const char *s1) | ||
|
|
||
this is wrong.
should be something like:
do not just change it to strlcpy, that is wrong too
also, you do not need the
s->append_char(s, 0)that is just madness,mowgli_string_tis meant to be a Pascal string, so use themempcpyabove to convert it correctly