<div dir="ltr">Fix segfault with "mount -o ro,remount".<div><br></div><div>Or any call to comma_scan where 'opt' appears as the last item in 'optlist'.</div><div><br></div><div><div>diff --git a/lib/getmountlist.c b/lib/getmountlist.c</div><div>index 30fb9a3..4fec41b 100644</div><div>--- a/lib/getmountlist.c</div><div>+++ b/lib/getmountlist.c</div><div>@@ -78,7 +78,7 @@ int comma_scan(char *optlist, char *opt, int clean)</div><div>     no = 2*(*s == 'n' && s[1] == 'o');</div><div>     if (optlen == len-no && !strncmp(opt, s+no, optlen)) {</div><div>       got = !no;</div><div>-      if (clean) memmove(s, optlist, strlen(optlist)+1);</div><div>+      if (clean && optlist) memmove(s, optlist, strlen(optlist)+1);</div><div>     }</div><div>   }</div><div> </div><div>diff --git a/tests/mount.test b/tests/mount.test</div><div>index 1fdc00f..d64bfc6 100755</div><div>--- a/tests/mount.test</div><div>+++ b/tests/mount.test</div><div>@@ -82,6 +82,10 @@ testing "mount -o ro $tmp_b_fs /mnt" \</div><div>   "mount -o ro $tmp_b_fs /mnt >/dev/null 2>&1 &&</div><div>    mkdir /mnt/testDir 2>/dev/null || sleep 1 && umount /mnt" "" "" ""</div><div> reCreateTmpFs</div><div>+testing "mount -o ro,remount $tmp_b_fs /mnt" \</div><div>+  "mount -o ro $tmp_b_fs /mnt >/dev/null 2>&1 &&</div><div>+   mkdir /mnt/testDir 2>/dev/null || sleep 1 && umount /mnt" "" "" ""</div><div>+reCreateTmpFs</div><div> </div><div> umount testDir1</div><div> rm -f $tmp_b_fs</div><div><br></div>
</div></div>