summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2005-03-26 21:37:56 +0000
committermickey <mickey@openbsd.org>2005-03-26 21:37:56 +0000
commitf99d2b31106b4ab9a66e289e4a7f8c8a7658d4ec (patch)
tree73e7115706c9d6aac1ac62269fb7a5993ac6c804
parentfix a typo (diff)
downloadwireguard-openbsd-f99d2b31106b4ab9a66e289e4a7f8c8a7658d4ec.tar.xz
wireguard-openbsd-f99d2b31106b4ab9a66e289e4a7f8c8a7658d4ec.zip
check for null and return error instead of stepping over it
-rw-r--r--usr.bin/sup/src/supcmeat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sup/src/supcmeat.c b/usr.bin/sup/src/supcmeat.c
index ff4e13f8011..a792a6d1478 100644
--- a/usr.bin/sup/src/supcmeat.c
+++ b/usr.bin/sup/src/supcmeat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supcmeat.c,v 1.19 2003/09/04 03:24:07 beck Exp $ */
+/* $OpenBSD: supcmeat.c,v 1.20 2005/03/26 21:37:56 mickey Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -561,6 +561,8 @@ needone(t, dummy)
struct stat sbuf;
newt = Tinsert (&lastT,t->Tname,TRUE);
+ if (!newt)
+ return (SCMERR);
newt->Tflags |= FUPDATE;
fetch = TRUE;
if ((thisC->Cflags&CFALL) == 0) {
@@ -602,6 +604,8 @@ needone(t, dummy)
}
/* If we get this far, we're either doing an update or a full fetch. */
newt = Tinsert(&needT, t->Tname, TRUE);
+ if (!newt)
+ return (SCMERR);
if (!fetch && S_ISREG(t->Tmode))
newt->Tflags |= FUPDATE;
return (SCMOK);