Bug 1310305: skip responding when failed to parse STUN message. r=mjf
MozReview-Commit-ID: D9Ox0nt81bF
--- a/media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
@@ -337,16 +337,19 @@ int nr_stun_server_process_request(nr_st
}
}
_status=0;
abort:
if (NR_STUN_GET_TYPE_CLASS(req->header.type) == NR_CLASS_INDICATION)
goto skip_response;
+ if (!res)
+ goto skip_response;
+
/* Now respond */
if (_status != 0 && ! nr_stun_message_has_attribute(res, NR_STUN_ATTR_ERROR_CODE, 0))
nr_stun_form_error_response(req, res, 500, "Failed to specify error");
if ((r=nr_stun_server_send_response(ctx, sock, peer_addr, res, clnt))) {
r_log(NR_LOG_STUN,LOG_ERR,"STUN-SERVER(label=%s): Failed sending response (my_addr=%s,peer_addr=%s)",ctx->label,ctx->my_addr.as_string,peer_addr->as_string);
_status = R_FAILED;