mirror of
https://github.com/openbsd/src.git
synced 2026-04-23 21:54:32 +00:00
fix crash on invalid tags file
If the tag entry points to the line number zero, less crashes because internally it uses that line number to imply that the tag is associated with a pattern. issue reported by Henry Ford (henryfordkjv at gmail), thanks! ok kirill@
This commit is contained in:
@@ -260,6 +260,10 @@ findctag(char *tag)
|
||||
*/
|
||||
tagendline = 0;
|
||||
taglinenum = getnum(&p, 0, &err);
|
||||
if (!err && taglinenum <= 0) {
|
||||
/* line numbers must be positive */
|
||||
continue;
|
||||
}
|
||||
if (err) {
|
||||
/*
|
||||
* No, it must be a pattern.
|
||||
|
||||
Reference in New Issue
Block a user