Ethereal-dev: [Ethereal-dev] bad buffer bound in packet-cpha.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Anil Madhavapeddy <anil@xxxxxxxxxx>
Date: Tue, 15 Apr 2003 20:28:46 +0100
Noticed this in Ethereal-0.9.11

-anil

--- packet-cpha.c.orig  Tue Apr 15 16:51:02 2003
+++ packet-cpha.c       Tue Apr 15 16:51:40 2003
@@ -237,7 +237,7 @@ dissect_cpha(tvbuff_t *tvb, packet_info
   hdr.filler = g_ntohs(hdr.filler);
   opcode  = g_ntohs(hdr.opcode);

-  snprintf(info,50,"CPHAv%d: %s",g_ntohs(hdr.ha_protocol_ver), opcode2str_short(opcode));
+  snprintf(info, sizeof info,"CPHAv%d: %s",g_ntohs(hdr.ha_protocol_ver), opcode2str_short(opcode));
   if (check_col(pinfo->cinfo, COL_INFO))
     col_add_str(pinfo->cinfo, COL_INFO,info);