res_http_websocket: Avoid reading past end of string
authorNickolay Shmyrev <nshmyrev@alphacephei.com>
Thu, 2 Jul 2020 22:19:50 +0000 (00:19 +0200)
committerJoshua Colp <jcolp@sangoma.com>
Mon, 13 Jul 2020 10:34:47 +0000 (05:34 -0500)
commite4d24f513734fbb2cff49c355b475851b4c701c3
tree1e710cf3012db0c650821fd87066d17cff3d9edc
parent5fbed5af24b8296b47cb0d6371f8187c1ee205cb
res_http_websocket: Avoid reading past end of string

We read beyond the end of the buffer when copying the string out of the
buffer when we used ast_copy_string() because the original string was
not null terminated. Instead switch to ast_strndup() which does not
exhibit the same behavior.

ASTERISK-28975 #close

Change-Id: Ib4a75cffeb1eb8cf01136ef30306bd623e531a2a
res/res_http_websocket.c