Bug 1338696: Don't deref null when nr_stun_message_create2 fails. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 13 Feb 2017 16:22:54 -0600
changeset 343982 e6e6e6ceb9c95d8663ee82353d44b35decb41714
parent 343981 2ad5216e9145d3f9941fe005237db8fad4365126
child 343983 6fceeb895ead04d4127540326e132017d1873c3d
push id37713
push userbcampen@mozilla.com
push dateTue, 21 Feb 2017 16:37:18 +0000
treeherderautoland@e6e6e6ceb9c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1338696
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1338696: Don't deref null when nr_stun_message_create2 fails. r=drno 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))) {