зеркало из https://github.com/mozilla/gecko-dev.git
Bug 849888 - Signaling - Enforce minimum buffer size in sub_send_msg r=jesup
This commit is contained in:
Родитель
708e027671
Коммит
b4ad96d47b
|
@ -45,6 +45,12 @@ sub_send_msg (cprBuffer_t buf, uint32_t cmd, uint16_t len, cc_srcs_t dst_id)
|
||||||
{
|
{
|
||||||
cpr_status_e rc;
|
cpr_status_e rc;
|
||||||
|
|
||||||
|
/* This buffer is assumed to be at least of size int */
|
||||||
|
MOZ_ASSERT(len >= sizeof(int));
|
||||||
|
if (len < sizeof(int)) {
|
||||||
|
return CPR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
CC_DEBUG_MSG sub_print_msg((char *)buf, len);
|
CC_DEBUG_MSG sub_print_msg((char *)buf, len);
|
||||||
|
|
||||||
switch (dst_id) {
|
switch (dst_id) {
|
||||||
|
|
|
@ -364,7 +364,7 @@ terminate_req (int request_id)
|
||||||
void
|
void
|
||||||
pres_terminate_req_all (void)
|
pres_terminate_req_all (void)
|
||||||
{
|
{
|
||||||
char dummy;
|
int dummy = 0;
|
||||||
|
|
||||||
(void) app_send_message(&dummy, sizeof(dummy), CC_SRC_MISC_APP,
|
(void) app_send_message(&dummy, sizeof(dummy), CC_SRC_MISC_APP,
|
||||||
SUB_MSG_PRESENCE_TERM_REQ_ALL);
|
SUB_MSG_PRESENCE_TERM_REQ_ALL);
|
||||||
|
@ -380,7 +380,7 @@ pres_terminate_req_all (void)
|
||||||
void
|
void
|
||||||
pres_sub_handler_initialized (void)
|
pres_sub_handler_initialized (void)
|
||||||
{
|
{
|
||||||
char dummy;
|
int dummy = 0;
|
||||||
|
|
||||||
(void) app_send_message(&dummy, sizeof(dummy), CC_SRC_MISC_APP,
|
(void) app_send_message(&dummy, sizeof(dummy), CC_SRC_MISC_APP,
|
||||||
SUB_HANDLER_INITIALIZED);
|
SUB_HANDLER_INITIALIZED);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче