]> The Tcpdump Group git mirrors - tcpdump/commitdiff
only attempt to print non-header data if there is something to print
authorhannes <hannes>
Sat, 2 Apr 2005 18:32:41 +0000 (18:32 +0000)
committerhannes <hannes>
Sat, 2 Apr 2005 18:32:41 +0000 (18:32 +0000)
print-isoclns.c

index 73ecfb469e0dc1897c662b6dee1fa38ce9389b9c..5eba78c52edfc18bd25380b8d547d2d1b5f3d1ee 100644 (file)
@@ -26,7 +26,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.131 2005-03-22 08:18:10 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.132 2005-04-02 18:32:41 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -817,9 +817,10 @@ static int clnp_print (const u_int8_t *pptr, u_int length)
             
         default:
             /* dump the PDU specific data */
-            printf("\n\t  undecoded non-header data, length %u",length-clnp_header->length_indicator);
-            print_unknown_data(pptr,"\n\t  ",length-(pptr-optr));
-
+            if (length-(pptr-optr) > 0) {
+                printf("\n\t  undecoded non-header data, length %u",length-clnp_header->length_indicator);
+                print_unknown_data(pptr,"\n\t  ",length-(pptr-optr));
+            }
         }
 
         return (1);