Skip to content

Commit

Permalink
upstream commit
Browse files Browse the repository at this point in the history
revision 1.41
date: 2014/10/08 05:35:27;  author: deraadt;  state: Exp;  lines: +3 -3;  commitid: JwTGarRLHQKDgPh2;
obvious realloc -> reallocarray conversion
  • Loading branch information
djmdjm committed Nov 15, 2019
1 parent ab36006 commit 2b6cba7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openbsd-compat/glob.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: glob.c,v 1.40 2013/09/30 12:02:34 millert Exp $ */
/* $OpenBSD: glob.c,v 1.41 2014/10/08 05:35:27 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -828,7 +828,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp,
return(GLOB_NOSPACE);
}

pathv = realloc(pglob->gl_pathv, newn * sizeof(*pathv));
pathv = reallocarray(pglob->gl_pathv, newn, sizeof(*pathv));
if (pathv == NULL)
goto nospace;
if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
Expand All @@ -840,7 +840,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp,
pglob->gl_pathv = pathv;

if ((pglob->gl_flags & GLOB_KEEPSTAT) != 0) {
statv = realloc(pglob->gl_statv, newn * sizeof(*statv));
statv = reallocarray(pglob->gl_statv, newn, sizeof(*statv));
if (statv == NULL)
goto nospace;
if (pglob->gl_statv == NULL && pglob->gl_offs > 0) {
Expand Down

0 comments on commit 2b6cba7

Please sign in to comment.