(void) cast strlcpy() call that uses truncation as part of its parsing
authorgilles <gilles@openbsd.org>
Sat, 19 Apr 2014 14:37:45 +0000 (14:37 +0000)
committergilles <gilles@openbsd.org>
Sat, 19 Apr 2014 14:37:45 +0000 (14:37 +0000)
logic to extract at most sizeof buf - 1 bytes from source

usr.sbin/smtpd/aldap.c

index 04fe7e5..3162e55 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: aldap.c,v 1.6 2013/06/03 15:53:48 eric Exp $ */
+/*     $OpenBSD: aldap.c,v 1.7 2014/04/19 14:37:45 gilles Exp $ */
 
 /*
  * Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -1240,7 +1240,7 @@ parseval(char *p, size_t len)
                }
 
                if (cp[j] == '\\') {
-                       strlcpy(hex, cp + j + 1, sizeof(hex));
+                       (void)strlcpy(hex, cp + j + 1, sizeof(hex));
                        buffer[i] = (char)strtoumax(hex, NULL, 16);
                        j += 3;
                } else {