Fix mount -a segfault without -O, reported by Janus Troelsen.
authorRob Landley <rob@landley.net>
Mon, 16 Mar 2015 18:27:16 +0000 (13:27 -0500)
committerRob Landley <rob@landley.net>
Mon, 16 Mar 2015 18:27:16 +0000 (13:27 -0500)
lib/getmountlist.c

index c0e6875..30fb9a3 100644 (file)
@@ -90,7 +90,7 @@ int comma_scanall(char *optlist, char *scanlist)
 {
   int i = 1;
 
-  for (;;) {
+  while (scanlist && *scanlist) {
     char *opt = comma_iterate(&scanlist, &i), *s = xstrndup(opt, i);
 
     i = comma_scan(optlist, s, 0);