summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-fr.c
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-10-05 02:49:49 +0000
committerkris <kris@FreeBSD.org>2000-10-05 02:49:49 +0000
commit0e6572e8c926177cef3761baf9d239b9e9fcd284 (patch)
tree272e6ba0729da219ce1b5874a9a588104608fee5 /contrib/tcpdump/print-fr.c
parent7790e4029528c008ed9548e6cd9cbc55f6d22c61 (diff)
downloadFreeBSD-src-0e6572e8c926177cef3761baf9d239b9e9fcd284.zip
FreeBSD-src-0e6572e8c926177cef3761baf9d239b9e9fcd284.tar.gz
* Buffer-safe string function cleanup. There are a couple of strcpy()
and strcat()s which would be more difficult to fix, but I think they're safe anyway. * Don't crash at runtime by overflowing a buffer with constant data in print-icmp.c on a long hostname. * Don't overflow a static buffer by trying to decode an AFS ACL into a buffer which is way too small for it. Reviewed by: -audit
Diffstat (limited to 'contrib/tcpdump/print-fr.c')
-rw-r--r--contrib/tcpdump/print-fr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/tcpdump/print-fr.c b/contrib/tcpdump/print-fr.c
index 80364d3..7039338 100644
--- a/contrib/tcpdump/print-fr.c
+++ b/contrib/tcpdump/print-fr.c
@@ -17,6 +17,8 @@
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $FreeBSD$
*/
#ifndef lint
@@ -395,12 +397,12 @@ q933_print(const u_char *p, int length)
break;
case LINK_VERIFY_IE_91:
case LINK_VERIFY_IE_94:
- sprintf(temp_str,"TX Seq: %3d, RX Seq: %3d",
+ snprintf(temp_str, sizeof(temp_str), "TX Seq: %3d, RX Seq: %3d",
ptemp[2], ptemp[3]);
decode_str = temp_str;
break;
case PVC_STATUS_IE:
- sprintf(temp_str,"DLCI %d: status %s %s",
+ snprintf(temp_str,sizeof(temp_str), "DLCI %d: status %s %s",
((ptemp[2]&0x3f)<<4)+ ((ptemp[3]&0x78)>>3),
ptemp[4] & 0x8 ?"new,":" ",
ptemp[4] & 0x2 ?"Active":"Inactive");
OpenPOWER on IntegriCloud