[asterisk-bugs] [JIRA] (ASTERISK-28975) res_http_websocket: Text payload data doesn't necessary include trailing zero

Friendly Automation (JIRA) noreply at issues.asterisk.org
Mon Jul 13 05:37:25 CDT 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=251406#comment-251406 ] 

Friendly Automation commented on ASTERISK-28975:
------------------------------------------------

Change 14655 merged by Friendly Automation:
res_http_websocket: Avoid reading past end of string

[https://gerrit.asterisk.org/c/asterisk/+/14655|https://gerrit.asterisk.org/c/asterisk/+/14655]

> res_http_websocket: Text payload data doesn't necessary include trailing zero
> -----------------------------------------------------------------------------
>
>                 Key: ASTERISK-28975
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28975
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_http_websocket
>    Affects Versions: 13.34.0, 16.11.1, 17.5.1
>            Reporter: Nickolay V. Shmyrev
>            Assignee: Nickolay V. Shmyrev
>
> According to websocket spec https://tools.ietf.org/html/rfc6455#section-5.7 and practice there is no trailing zero for text messages, however, the code of ast_websocket_read_string expects them in this part:
> {code}
> 	if (!(*buf = ast_malloc(payload_len + 1))) {
> 		return -1;
> 	}
> 	ast_copy_string(*buf, payload, payload_len + 1);
> 	return payload_len + 1;
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list