STUN/netsock2: Fix some valgrind uninitialized memory findings.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 10 Aug 2017 19:18:01 +0000 (14:18 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 10 Aug 2017 19:38:12 +0000 (14:38 -0500)
commitbd28a9bbd8ee88f8747b512d51a8ed6a5929e494
tree918a080cb7df66db6727c54fb2c0af8bf9fe73ef
parent4ed2733ddea705761f0e340cdcba972a5f8be68a
STUN/netsock2: Fix some valgrind uninitialized memory findings.

* netsock2.c: Test the addr->len member first as it may be the only member
initialized in the struct.

* stun.c:ast_stun_handle_packet(): The combinded[] local array could get
used uninitialized by ast_stun_request().  The uninitialized string gets
copied to another location and could overflow the destination memory
buffer.

These valgrind findings were found for ASTERISK_27150 but are not
necessarily a fix for the issue.

Change-Id: I55f8687ba4ffc0f69578fd850af006a56cbc9a57
main/netsock2.c
main/stun.c