]> The Tcpdump Group git mirrors - tcpdump/commitdiff
RESP: Fix Coverity warnings
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 19 Jul 2016 12:37:47 +0000 (14:37 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 19 Jul 2016 12:37:47 +0000 (14:37 +0200)
The warnings were:
Calling "fn_printn" without checking return value (as is done elsewhere
52 out of 56 times)

print-resp.c

index 0aa3d69e6775c2781f39de366aa441fc30838399..5e36edafdae5398e69f48292238d42c8ef77674e 100644 (file)
@@ -141,7 +141,8 @@ static int resp_print_inline(netdissect_options *, register const u_char *, int)
  */
 #define RESP_PRINT_SEGMENT(_ndo, _bp, _len)            \
         ND_PRINT((_ndo, " \""));                       \
-        fn_printn(_ndo, _bp, _len, _ndo->ndo_snapend); \
+        if (fn_printn(_ndo, _bp, _len, _ndo->ndo_snapend)) \
+               goto trunc; \
         fn_print_char(_ndo, '"');
 
 void