When pccard_safe_quote is passed NULL for src, it shouldn't panic.

Someone sent me this a while ago, but I can't find who to give them
proper credit...
This commit is contained in:
Warner Losh 2006-04-27 20:47:13 +00:00
parent af785a075f
commit c171ec35b6

View file

@ -974,7 +974,7 @@ pccard_safe_quote(char *dst, const char *src, size_t len)
if (len == 0)
return;
while (walker < ep)
while (src != NULL && walker < ep)
{
if (*src == '"') {
if (ep - walker < 2)