projects
/
claws.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0bc73a0
)
Fix possibly not null-terminated string
author
Colin Leroy
<colin@colino.net>
Thu, 8 Oct 2015 17:08:23 +0000
(19:08 +0200)
committer
Colin Leroy
<colin@colino.net>
Thu, 8 Oct 2015 17:08:23 +0000
(19:08 +0200)
src/plugins/clamd/libclamd/clamd-plugin.c
patch
|
blob
|
history
diff --git
a/src/plugins/clamd/libclamd/clamd-plugin.c
b/src/plugins/clamd/libclamd/clamd-plugin.c
index b50fb905045ea3cbdaf2daa53c2e2dc211617d52..5f58cfad97ff468ac35ba563f34d8200c56f7701 100644
(file)
--- a/
src/plugins/clamd/libclamd/clamd-plugin.c
+++ b/
src/plugins/clamd/libclamd/clamd-plugin.c
@@
-389,7
+389,7
@@
Clamd_Stat clamd_init(Clamd_Socket* config) {
}
memset(buf, '\0', sizeof(buf));
while ((n_read = read(sock, buf, sizeof(buf))) > 0) {
- buf[
sizeof(buf) - 1
] = '\0';
+ buf[
n_read
] = '\0';
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) - 1] = '\0';
debug_print("Version: %s\n", buf);
@@
-526,7
+526,7
@@
Clamd_Stat clamd_verify_email(const gchar* path, response* result) {
g_free(command);
memset(buf, '\0', sizeof(buf));
while ((n_read = read(sock, buf, BUFSIZ)) > 0) {
- buf[
sizeof(buf) - 1
] = '\0';
+ buf[
n_read
] = '\0';
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) - 1] = '\0';
}