Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makefs PR/51652: Sevan Janiyan: makefs dies due to ...



details:   https://anonhg.NetBSD.org/src/rev/078f81f5ee79
branches:  trunk
changeset: 349154:078f81f5ee79
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 25 23:02:44 2016 +0000

description:
PR/51652: Sevan Janiyan: makefs dies due to segmentation fault
Don't dereference NULL when running out of nodes during rename.

diffstat:

 usr.sbin/makefs/cd9660.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c6c56ce30df3 -r 078f81f5ee79 usr.sbin/makefs/cd9660.c
--- a/usr.sbin/makefs/cd9660.c  Fri Nov 25 20:01:05 2016 +0000
+++ b/usr.sbin/makefs/cd9660.c  Fri Nov 25 23:02:44 2016 +0000
@@ -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 @@
 
        tmp = emalloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING);
 
-       while (i < num) {
+       while (i < num && iter) {
                powers = 1;
                count = 0;
                digits = 1;



Home | Main Index | Thread Index | Old Index