mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-25 07:49:18 +00:00
In cgetmatch(3), return -1 if a NULL or 0-length name parameter is used.
This situation most notably arises in chkprintcap, when a /etc/printcap entry has an empty rp= attribute. In that case, cgetmatch would enter an infinite loop if any entry in the file has multiple names. This causes lpd to hang at boot time on 5.0-DP2 when both conditions are met (:rp=: and multiple names -- not necessarily on the same entry). Reviewed by: roberto
This commit is contained in:
parent
105df8c3d7
commit
464ef179a0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108553
@ -577,6 +577,9 @@ cgetmatch(const char *buf, const char *name)
|
||||
{
|
||||
const char *np, *bp;
|
||||
|
||||
if (name == NULL || *name == '\0')
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* Start search at beginning of record.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user