Bug 273220 - "scriptedpart DEFAULT" will segfault with unformatted disks
Summary: "scriptedpart DEFAULT" will segfault with unformatted disks
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-18 23:45 UTC by Lars Kellogg-Stedman
Modified: 2023-08-18 23:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Kellogg-Stedman 2023-08-18 23:45:45 UTC
Called as `bsdinstall scriptedpart DEFAULT`, partedit will arrive at line 204...

    return (part_config(disk, scheme, partconfig));

...with `disk`, `scheme`, and `partconfig` all set to `NULL`. These are passed to `part_config()`, which on line 79 calls:

    if (provider_for_name(&mesh, disk) == NULL) {

With `disk` == `NULL`. In `provider_for_name()`, on line 52, we have:

    if (strcmp(pp->lg_name, name) == 0)

Here, `name` is `NULL` (it receives the value of `disk` from `part_config()`, and this triggers a segfault.