Bug 1338696 - Don't deref null when nr_stun_message_create2 fails. r=drno, a=jcristau
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 13 Feb 2017 16:22:54 -0600
changeset 378711 faa3b0ea01237c74a055568f3bd82b1b3f371cb4
parent 378710 f024cf09cb2c192de90cf309ceea52da84455530
child 378712 a5357f98767044783946a3719dd04fa20a3bd108
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, jcristau
bugs1338696
milestone53.0a2
Bug 1338696 - Don't deref null when nr_stun_message_create2 fails. r=drno, a=jcristau MozReview-Commit-ID: 6yo1NtElboR
media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
--- a/media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_server_ctx.c
@@ -334,20 +334,20 @@ int nr_stun_server_process_request(nr_st
 
             nr_stun_form_error_response(req, res, error, "ICE Failure");
             ABORT(R_ALREADY);
         }
     }
 
     _status=0;
   abort:
-    if (NR_STUN_GET_TYPE_CLASS(req->header.type) == NR_CLASS_INDICATION)
+    if (!res)
         goto skip_response;
 
-    if (!res)
+    if (NR_STUN_GET_TYPE_CLASS(req->header.type) == NR_CLASS_INDICATION)
         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))) {