Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Aug 2023 22:43:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 273218] scriptedpart will segfault if not provided with any arguments
Message-ID:  <bug-273218-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273218

            Bug ID: 273218
           Summary: scriptedpart will segfault if not provided with any
                    arguments
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: lars@oddbit.com

Running `bsdinstall scriptedpart` runs the `scripted_editor` function in the
`partedit` sources, which starts like this:

    fp = open_memstream(&input, &len);
    fputs(argv[1], fp);
    for (i = 2; i < argc; i++) {
      fprintf(fp, " %s", argv[i]);
    }
    fclose(fp);

That `puts(argv[1], fp)` will segfault if there are no arguments.

`bsdinstall scriptedpart` should exit with an error message instead of
segfaulting.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273218-227>