From: Neil Brown Date: Mon, 29 May 2006 02:06:32 +0000 (+0000) Subject: snprintf size should be at most the size of the buffer X-Git-Tag: mdadm-2.5.1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=382245c31fb3bad644fcd7d1fe51242304ba594b;p=thirdparty%2Fmdadm.git snprintf size should be at most the size of the buffer From: Luca Berra Signed-off-by: Neil Brown --- diff --git a/util.c b/util.c index d36feb53..279bfd77 100644 --- a/util.c +++ b/util.c @@ -446,7 +446,7 @@ char *map_dev(int major, int minor, int create) } if (create && !std && !nonstd) { static char buf[30]; - snprintf(buf, 1024, "%d:%d", major, minor); + snprintf(buf, sizeof(buf), "%d:%d", major, minor); nonstd = buf; }