If a well-formed SIP message is received, but one of its recognized headers contains malformed content, e.g.
CSeq: abcdefg
then it will crash the program.
The cause is in this line:
m.headers[name] = (parsers[name] || parseGenericHeader)({s:r[2], i:0}, m.headers[name]);
The problem is that any of the given parsers may crash on invalid input. And since this is called from the transport layer, this can bubble all the way up without encountering any app-specific code.
This could be fixed either with a try-catch, or by rewriting the parsers to handle invalid input more gracefully.
If a well-formed SIP message is received, but one of its recognized headers contains malformed content, e.g. CSeq: abcdefg then it will crash the program.
The cause is in this line:
m.headers[name] = (parsers[name] || parseGenericHeader)({s:r[2], i:0}, m.headers[name]);
The problem is that any of the given parsers may crash on invalid input. And since this is called from the transport layer, this can bubble all the way up without encountering any app-specific code.
This could be fixed either with a try-catch, or by rewriting the parsers to handle invalid input more gracefully.