]> andersk Git - openssh.git/commitdiff
- (dtucker) [openbsd-compat/bsd-snprintf.c] Check for max length too.
authordtucker <dtucker>
Tue, 21 Sep 2004 11:32:12 +0000 (11:32 +0000)
committerdtucker <dtucker>
Tue, 21 Sep 2004 11:32:12 +0000 (11:32 +0000)
   ok djm@

ChangeLog
openbsd-compat/bsd-snprintf.c

index 7998f005435543fcf314ac038c4c10ac6716c04a..ffb9ba7c7979e64bda9af450c45399bda816d4eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20040921
+ - (dtucker) [openbsd-compat/bsd-snprintf.c] Check for max length too.
+   ok djm@
+
 20040912
  - (djm) [loginrec.c] Start KNF and tidy up of this long-neglected file.
    No change in resultant binary
index 1834e587622bd37b2a68b035caf2625b2416ee10..9d06b4f01ab00579c3002da0810ed0351e953b9f 100644 (file)
@@ -369,7 +369,7 @@ fmtstr(char *buffer, size_t *currlen, size_t maxlen,
        if (value == 0) 
                value = "<NULL>";
 
-       for (strln = 0; value[strln]; ++strln); /* strlen */
+       for (strln = 0; strln <= max && value[strln]; ++strln); /* strlen */
        padlen = min - strln;
        if (padlen < 0) 
                padlen = 0;
This page took 0.042223 seconds and 5 git commands to generate.