From: Derrick Brashear Date: Sun, 11 Feb 2001 02:57:17 +0000 (+0000) Subject: use-snprintf-for-krb-udp-error-packets-20010210 X-Git-Tag: BP-openafs-devel-autoconf~82 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ba461fc17059946155f2413e3f7accc6964d9921;p=packages%2Fo%2Fopenafs.git use-snprintf-for-krb-udp-error-packets-20010210 Avoid potential for overrunning buffer --- diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index 0d470a8c3..78c28d6b0 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -560,7 +560,7 @@ static err_packet (ksoc, pkt, code, reason) if (reason == 0) reason = ""; else if (strlen(reason) + 20 > sizeof(buf)) reason = "reason too long"; - sprintf (buf, "code = %d: %s", code, reason); + snprintf (buf, 255, "code = %d: %s", code, reason); if (krb_udp_debug) { printf ("Sending error packet to '%s'.'%s'@'%s' containing %s\n",