Skip to content

Commit 87580d7

Browse files
hcemaxteufel
authored andcommitted
Do not copy more bytes than were allocated
1 parent 2d4af7a commit 87580d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: modules/transport/xmlrpc/xmlrpclib.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,9 @@ void xmlrpc_char_encode(char *outbuffer, const char *s1)
777777
s->append_char(s, c);
778778
}
779779
}
780+
s->append_char(s, 0);
780781

781-
memcpy(outbuffer, s->str, XMLRPC_BUFSIZE);
782+
strncpy(outbuffer, s->str, XMLRPC_BUFSIZE);
782783
}
783784

784785
static void xmlrpc_append_char_encode(mowgli_string_t *s, const char *s1)

0 commit comments

Comments
 (0)