Searched hist:"38882604713248062 dd44b4465b5a81244025850" (Results 1 – 1 of 1) sorted by relevance
| /src/sbin/devmatch/ |
| H A D | devmatch.c | 38882604713248062dd44b4465b5a81244025850 Wed Dec 27 18:30:24 UTC 2017 Warner Losh <imp@FreeBSD.org> Fix a bunch of issues (and a few non-issues but appeasement is easier than arguing) Coverity found:
o Use open + fstat rather than stat + open to avoid any races for a file that's static for the life of the system. This will prevent any problems should someone insert a new device while installing a kernel in the future. o Use strlcpy instead of strcpy as a failsafe to knowing that the strings can't possibly be larger than the buffer due to data source limits (though in the future these limits might be more dynamic). o If we can't find the hints file, return rather than dereference a NULL pointer. o Check for lastmod before calling strcmp in case a PNP entry comes before a module entry. That's not allowed, but within the realm of crazy things programmers do. o Free lastmod before exiting search_hints() to avoid a leak.
CID: 1383971, 1383970, 1383969, 1383965, 1383963, 1383960
|