Fix handling of some ISDN calls.

There's no guarantee that there will be two digits after PRI-XMIT or
PRI-RCV; the capture file in bug 3535, for exmaple, has "PRI-XMIT-0/1"
and "PRI-RCV-0".

Require a minimum of 1, not 2, non-{/(:} characters.  Leave the maximum
of 20 in place.

Change-Id: Ie8f8f4ff5eb04baf0ee61bf28015e59a1fa43948
Reviewed-on: https://code.wireshark.org/review/29947
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-09-30 21:23:04 -07:00
parent fac429cf99
commit 5428e8ddbe
1 changed files with 17 additions and 1 deletions

View File

@ -196,12 +196,28 @@ WDD_TYPE "type "[^\n\r\t ]+
return WDS_PREFIX;
}
/*
* If we allow an arbitrary non-zero number of non-left-parentheses after
* "ETHER", that means that some file that has ETHER followed by a lot of
* text (see, for example, tpncp/tpncp.dat in the source tree) can cause
* either an infinite loop or a loop that take forever to finish, as the
* scanner keeps swallowing characters. Limit it to 20 characters.
*
* XXX - any reason to require at least two of them?
*/
<sc_ether_direction>[^\(]{2,20} {
BEGIN(sc_gen_task);
return STRING;
}
<sc_isdn_call>[^\/\(:]{2,20} {
/*
* If we allow an arbitrary non-zero number of non-slash, non-left-parentheses,
* non-colon characters after "PRI-XMIT", that means that some file that has
* PRI-XMIT= followed by a lot of text can cause either an infinite loop or
* a loop that take forever to finish, as the scanner keeps swallowing
* characters. Limit it to 20 characters.
*/
<sc_isdn_call>[^\/\(:]{1,20} {
BEGIN(sc_gen_task);
return DECNUM;
}