]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: fix sgi_check_bootfile name size minimum
authormr-bronson <ghbugs@toeai.com>
Sun, 18 Aug 2024 00:54:08 +0000 (00:54 +0000)
committerKarel Zak <kzak@redhat.com>
Fri, 3 Jan 2025 11:21:42 +0000 (12:21 +0100)
The name does not contain newline, so the comment and logic was wrong.

(cherry picked from commit 6dfc07a7189eea461d52ff85620b286a4817a658)

libfdisk/src/sgi.c

index f2f5073f504e29cd59a0e699ace0d8341e1df63e..2293a20b4080e5a1bab672237ad98ce2d6c395c6 100644 (file)
@@ -391,8 +391,8 @@ static int sgi_check_bootfile(struct fdisk_context *cxt, const char *name)
 
        sz = strlen(name);
 
-       if (sz < 3) {
-               /* "/a\n" is minimum */
+       if (sz < 2) {
+               /* "/a" is minimum */
                fdisk_warnx(cxt, _("Invalid bootfile!  The bootfile must "
                                   "be an absolute non-zero pathname, "
                                   "e.g. \"/unix\" or \"/unix.save\"."));