diff options
author | Dario Lombardo <lomato@gmail.com> | 2017-12-29 20:07:24 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2018-01-02 03:38:16 +0000 |
commit | 098fbc70ee43f0b38208068e842325a252770fda (patch) | |
tree | 33fd889f2d57547a84b43caa0b6601969eb8e19e /wsutil/ws_pipe.c | |
parent | 9aa42e89c3fdc83ad2fa4ab17a2686d79be44a62 (diff) |
ws_pipe: provide a null terminated string anyway (CID: 1364684).
Change-Id: I4143b499986cbd31db524db73dde72ddbe26077d
Reviewed-on: https://code.wireshark.org/review/25072
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'wsutil/ws_pipe.c')
-rw-r--r-- | wsutil/ws_pipe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/wsutil/ws_pipe.c b/wsutil/ws_pipe.c index 7f3f16937b..9b19668a69 100644 --- a/wsutil/ws_pipe.c +++ b/wsutil/ws_pipe.c @@ -23,6 +23,7 @@ #endif #include <glib.h> +#include <log.h> #include "wsutil/ws_pipe.h" @@ -106,7 +107,8 @@ ws_read_string_from_pipe(ws_pipe_handle read_pipe, gchar *buffer, if (buffer_bytes_remaining == 0) { /* The string won't fit in the buffer. */ - /* XXX - provide an error string */ + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Buffer too small (%ld).", buffer_size); + buffer[buffer_size - 1] = '\0'; return FALSE; } |