Module Name: src
Committed By: christos
Date: Fri Nov 25 23:02:45 UTC 2016
Modified Files:
src/usr.sbin/makefs: cd9660.c
Log Message:
PR/51652: Sevan Janiyan: makefs dies due to segmentation fault
Don't dereference NULL when running out of nodes during rename.
To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/makefs/cd9660.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/makefs/cd9660.c
diff -u src/usr.sbin/makefs/cd9660.c:1.52 src/usr.sbin/makefs/cd9660.c:1.53
--- src/usr.sbin/makefs/cd9660.c:1.52 Thu Dec 24 10:52:37 2015
+++ src/usr.sbin/makefs/cd9660.c Fri Nov 25 18:02:44 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos 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
@@ -103,7 +103,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos Exp $");
+__RCSID("$NetBSD: cd9660.c,v 1.53 2016/11/25 23:02:44 christos Exp $");
#endif /* !__lint */
#include <string.h>
@@ -1079,7 +1079,7 @@ cd9660_rename_filename(iso9660_disk *dis
tmp = emalloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING);
- while (i < num) {
+ while (i < num && iter) {
powers = 1;
count = 0;
digits = 1;