From 0f345a5f1e841e2d61ba049644acd3b2edbb1720 Mon Sep 17 00:00:00 2001 From: Moritz Jodeit Date: Thu, 28 Apr 2005 10:10:50 +0000 Subject: more snprintf checking. ok krw@ --- sys/dev/microcode/aic7xxx/aicasm_gram.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/microcode/aic7xxx/aicasm_gram.y b/sys/dev/microcode/aic7xxx/aicasm_gram.y index 4b5e9d2c570..234bc977468 100644 --- a/sys/dev/microcode/aic7xxx/aicasm_gram.y +++ b/sys/dev/microcode/aic7xxx/aicasm_gram.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: aicasm_gram.y,v 1.12 2004/09/18 19:51:53 mickey Exp $ */ +/* $OpenBSD: aicasm_gram.y,v 1.13 2005/04/28 10:10:49 moritz Exp $ */ /* $NetBSD: aicasm_gram.y,v 1.3 2003/04/19 19:26:11 fvdl Exp $ */ /* @@ -1554,7 +1554,7 @@ add_macro_arg(const char *argtext, int argnum) retval = snprintf(regex_pattern, sizeof(regex_pattern), "[^-/A-Za-z0-9_](%s)([^-/A-Za-z0-9_]|$)", argtext); - if (retval >= sizeof(regex_pattern)) { + if (retval == -1 || retval >= sizeof(regex_pattern)) { stop("Regex text buffer too small for arg", EX_SOFTWARE); /* NOTREACHED */ -- cgit v1.2.3