From a8e2d00f1cda3e9c4859301e2078cfb91dde1827 Mon Sep 17 00:00:00 2001 From: tedu Date: Fri, 16 Jan 2015 06:00:39 +0000 Subject: [PATCH] just to be careful, add a cpp guard that the sscanf sizes are ok --- usr.bin/signify/signify.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index 7ef990d9ad7..ec7a791cd32 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.98 2015/01/15 22:21:01 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.99 2015/01/16 06:00:39 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst * @@ -592,6 +592,9 @@ verifychecksums(char *msg, int argc, char **argv, int quiet) while (line && *line) { if ((endline = strchr(line, '\n'))) *endline++ = '\0'; +#if PATH_MAX < 1024 || HASHBUFSIZE < 224 +#error sizes are wrong +#endif rv = sscanf(line, "%31s (%1023s = %223s", c.algo, c.file, c.hash); if (rv != 3 || c.file[0] == 0 || c.file[strlen(c.file)-1] != ')') -- 2.20.1