diff options
author | natano <natano@openbsd.org> | 2016-11-26 18:57:25 +0000 |
---|---|---|
committer | natano <natano@openbsd.org> | 2016-11-26 18:57:25 +0000 |
commit | 4e4cca72b42f24a133daa106d9fe1c85c124f80d (patch) | |
tree | e49e798a1dd6713b2426191337467dd2558c1904 /usr.sbin/makefs | |
parent | Add the vmctl start -n option to specify add a network interface to (diff) | |
download | wireguard-openbsd-4e4cca72b42f24a133daa106d9fe1c85c124f80d.tar.xz wireguard-openbsd-4e4cca72b42f24a133daa106d9fe1c85c124f80d.zip |
Avoid NULL pointer dereference in cd9660.
from christos@NetBSD via mestre
Original Log Message:
PR/51652: Sevan Janiyan: makefs dies due to segmentation fault
Don't dereference NULL when running out of nodes during rename.
Diffstat (limited to 'usr.sbin/makefs')
-rw-r--r-- | usr.sbin/makefs/cd9660.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index f37dff6e863..0d4abd5033d 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1,5 +1,5 @@ -/* $OpenBSD: cd9660.c,v 1.17 2016/10/26 15:31:13 natano Exp $ */ -/* $NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos Exp $ */ +/* $OpenBSD: cd9660.c,v 1.18 2016/11/26 18:57:25 natano Exp $ */ +/* $NetBSD: cd9660.c,v 1.53 2016/11/25 23:02:44 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -935,7 +935,7 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, tmp = emalloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING); - while (i < num) { + while (i < num && iter) { powers = 1; count = 0; digits = 1; |