Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 15b9925

Browse files
committed
Append null terminator after string copying
The buffer length passed to the callback is the actual length minus 1, so 'buflen' is not out-of-bounds but exactly the last byte of the buffer. Change-Id: I63a2bb1928c80f5c78dac7133133ad2c89f82e5f
1 parent a3539f1 commit 15b9925

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎web.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ int web_eventmux(char *buf, size_t buflen)
260260
char *buffer = "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n";
261261
web_send(web_connfd, buffer);
262262
strncpy(buf, p, buflen);
263+
buf[buflen] = '0円';
263264
free(p);
264265
close(web_connfd);
265266
return strlen(buf);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /