Bug 1464069 - Check for null message in nr_stun_decode_message; r?drno
MozReview-Commit-ID: B1SHDte4miv
--- a/media/mtransport/third_party/nICEr/src/stun/stun_codec.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_codec.c
@@ -1410,16 +1410,19 @@ nr_stun_decode_message(nr_stun_message *
int r,_status;
int offset;
int size;
int padding_bytes;
nr_stun_message_attribute *attr;
nr_stun_attr_info *attr_info;
Data *password;
+ if (!msg)
+ ABORT(R_BAD_ARGS);
+
r_log(NR_LOG_STUN, LOG_DEBUG, "Parsing STUN message of %d bytes", msg->length);
if (!TAILQ_EMPTY(&msg->attributes))
ABORT(R_BAD_ARGS);
if (sizeof(nr_stun_message_header) > msg->length) {
r_log(NR_LOG_STUN, LOG_WARNING, "Message too small");
ABORT(R_FAILED);