Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/tftpd Check snprintf for -1 (Maxime Villard)



details:   https://anonhg.NetBSD.org/src/rev/99f65f8c27d7
branches:  trunk
changeset: 787798:99f65f8c27d7
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 03 21:20:45 2013 +0000

description:
Check snprintf for -1 (Maxime Villard)

diffstat:

 libexec/tftpd/tftpd.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r b04b6447fee4 -r 99f65f8c27d7 libexec/tftpd/tftpd.c
--- a/libexec/tftpd/tftpd.c     Wed Jul 03 20:17:07 2013 +0000
+++ b/libexec/tftpd/tftpd.c     Wed Jul 03 21:20:45 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tftpd.c,v 1.40 2013/06/28 17:20:15 christos Exp $      */
+/*     $NetBSD: tftpd.c,v 1.41 2013/07/03 21:20:45 christos Exp $      */
 
 /*
  * Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "@(#)tftpd.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: tftpd.c,v 1.40 2013/06/28 17:20:15 christos Exp $");
+__RCSID("$NetBSD: tftpd.c,v 1.41 2013/07/03 21:20:45 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -488,7 +488,7 @@
 
        rexmtval = tout;
        if (asize > *ackl && (l = snprintf(ack + *ackl, asize - *ackl,
-           "timeout%c%lu%c", 0, tout, 0)))
+           "timeout%c%lu%c", 0, tout, 0)) > 0)
                *ackl += l;
        else
                return -1;
@@ -714,7 +714,7 @@
                        if (sizeof(oackbuf) > alen &&
                            (l = snprintf(oackbuf + alen,
                            sizeof(oackbuf) - alen, "tsize%c%u%c", 0,
-                           tftp_tsize, 0)))
+                           tftp_tsize, 0)) > 0)
                                alen += l;
                }
                oack_h = (struct tftphdr *) oackbuf;



Home | Main Index | Thread Index | Old Index