checkfile protection from caller

Changes to be committed:
	modified:   src/pager.c
This commit is contained in:
nhmall
2015-04-25 10:51:07 -04:00
parent 5828d17eef
commit 07c5467434

View File

@@ -310,6 +310,14 @@ checkfile(inp, pm, user_typed_name, without_asking)
return;
}
/*
* If someone passed us garbage, prevent fault
*
if (!inp || (inp && strlen(inp) > (BUFSZ - 1))) {
pline("bad do_look buffer passed!");
return;
}
/* To prevent the need for entries in data.base like *ngel to account
* for Angel and angel, make the lookup string the same for both
* user_typed_name and picked name.