]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cdp.c
CVE-2017-13040/MPTCP: Clean up printing DSS suboption.
[tcpdump] / print-cdp.c
index 96ef143b158ec4f2c347a1702290b29e78f042a5..6f8f356736feb24621f456672163b417e1a0396f 100644 (file)
@@ -24,6 +24,8 @@
  *    http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
  */
 
+/* \summary: Cisco Discovery Protocol (CDP) printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -169,9 +171,11 @@ cdp_print(netdissect_options *ndo,
                        ND_PRINT((ndo, "\n\t  "));
                        for (i=0;i<len;i++) {
                            j = *(tptr+i);
-                           ND_PRINT((ndo, "%c", j));
-                           if (j == 0x0a) /* lets rework the version string to get a nice indentation */
-                               ND_PRINT((ndo, "\t  "));
+                           if (j == '\n') /* lets rework the version string to
+                                             get a nice indentation */
+                               ND_PRINT((ndo, "\n\t  "));
+                           else
+                               fn_print_char(ndo, j);
                        }
                        break;
                    case 0x06: /* Platform */