From 371275cabfe7ee71db4f4e23b9a5d966b335d3bc Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 29 Apr 2015 04:00:25 +0000 Subject: Change internal xrealloc() to a idiom-following xreallocarray(). This loses a "new size is 0" failure case. Probably not relevant; and since we develop this in OpenBSD, we'll catch that before someone else imports this... ok millert --- usr.bin/diff/diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/diff/diff.c') diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index fbe46714f7d..743e9332f36 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.58 2015/01/16 06:40:07 deraadt Exp $ */ +/* $OpenBSD: diff.c,v 1.59 2015/04/29 04:00:25 deraadt Exp $ */ /* * Copyright (c) 2003 Todd C. Miller @@ -337,7 +337,7 @@ push_ignore_pats(char *pattern) else { /* old + "|" + new + NUL */ len = strlen(ignore_pats) + strlen(pattern) + 2; - ignore_pats = xrealloc(ignore_pats, 1, len); + ignore_pats = xreallocarray(ignore_pats, 1, len); strlcat(ignore_pats, "|", len); strlcat(ignore_pats, pattern, len); } -- cgit v1.2.3-59-g8ed1b