pbx_spool: Gracefully handle long lines in call files
authorSean Bright <sean.bright@gmail.com>
Mon, 6 Mar 2017 19:15:45 +0000 (14:15 -0500)
committerSean Bright <sean.bright@gmail.com>
Mon, 6 Mar 2017 21:29:52 +0000 (15:29 -0600)
commit5a74abc53bb59590ffb8be1363e2d82ebe1755b4
tree80ae4e786bcf5dec683ecfe81ad18fb0c86e88c8
parentc9296b23d1574332ccbc83f3fc7ba492cfc34cfe
pbx_spool: Gracefully handle long lines in call files

Per the linked issue, we aren't checking the buffer filled by fgets()
to determine if it contains a newline, so we will fail to correctly
parse the trailing portion of a long line.

This patch increases the buffer size from 256 to 1024, and skips any
line that exceeds that length, logging a warning in the process.

ASTERISK-17067 #close
Reported by: Dave Olszewski

Change-Id: I51bcf270c1b4347ba05b43f18dc2094c76f5d7b0
pbx/pbx_spool.c