mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
pciconf(8): Replace an assert with errx
The condition can be hit with simple user input, so it isn't an invariant. Just error out. PR: 217003 Reported by: Vladislav V. Prodan <admin at support.od.ua> Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
5ede40dcf2
commit
ae9dddfc09
1 changed files with 2 additions and 1 deletions
|
|
@ -879,7 +879,8 @@ getdevice(const char *name)
|
|||
errx(1, "Device name is too long");
|
||||
memcpy(patterns[0].pd_name, name, cp - name);
|
||||
patterns[0].pd_unit = strtol(cp, &cp, 10);
|
||||
assert(*cp == '\0');
|
||||
if (*cp != '\0')
|
||||
errx(1, "Invalid device name");
|
||||
patterns[0].flags = PCI_GETCONF_MATCH_NAME | PCI_GETCONF_MATCH_UNIT;
|
||||
pc.num_patterns = 1;
|
||||
pc.pat_buf_len = sizeof(patterns);
|
||||
|
|
|
|||
Loading…
Reference in a new issue