commit 3f37fcce10bcfa459de264e16fa5fe1af11266da parent 626d2ce199ae3dfe0d9df9c9066c9db0a1954f8c Author: wwp <wwp@free.fr> Date: Fri, 13 Apr 2018 12:32:47 +0200 ClamAV plugin: manage read errors (fixes CID #1220483). Diffstat:
| M | src/plugins/clamd/libclamd/clamd-plugin.c | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c @@ -556,6 +556,12 @@ Clamd_Stat clamd_verify_email(const gchar* path, response* result) { if (n_read == 0) { buf[n_read] = '\0'; debug_print("response: %s\n", buf); + } else { + /* in case read() fails */ + debug_print("read error %d\n", errno); + result->msg = NULL; + close(sock); + return NO_CONNECTION; } } if (strstr(buf, "ERROR")) {