diff options
author | piso <piso@FreeBSD.org> | 2007-04-07 09:52:36 +0000 |
---|---|---|
committer | piso <piso@FreeBSD.org> | 2007-04-07 09:52:36 +0000 |
commit | 591e129226ccdb979c1e1344a0a573431f4c297b (patch) | |
tree | 7c20bf824fcfc6820659d7d2a073d534c3909066 /sys/netinet | |
parent | 9e43cc8d0331788d5a6aa2032d74b21f3c3221c5 (diff) | |
download | FreeBSD-src-591e129226ccdb979c1e1344a0a573431f4c297b.zip FreeBSD-src-591e129226ccdb979c1e1344a0a573431f4c297b.tar.gz |
Prevent the usage of an uninitialized variable: do not accept
StartMediaTx message before an OpnRcvChnAck message was received.
Reviewed by: glebius
Approved by: glebius (mentor)
MFC after: 3 days
Found with: Coverity Prevent(tm)
CID: 498
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/libalias/alias_skinny.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet/libalias/alias_skinny.c b/sys/netinet/libalias/alias_skinny.c index 91307ac..e726e55 100644 --- a/sys/netinet/libalias/alias_skinny.c +++ b/sys/netinet/libalias/alias_skinny.c @@ -309,6 +309,7 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk) size_t orig_len, skinny_hdr_len = sizeof(struct skinny_header); ConvDirection direction; + lip = -1; tc = (struct tcphdr *)ip_next(pip); hlen = (pip->ip_hl + tc->th_off) << 2; tlen = ntohs(pip->ip_len); @@ -418,6 +419,16 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk) #endif return; } + if (lip == -1) { +#ifdef LIBALIAS_DEBUG + fprintf(stderr, + "PacketAlias/Skinny: received a" + " packet,StartMediaTx Message before" + " packet,OpnRcvChnAckMsg\n" +#endif + return; + } + #ifdef LIBALIAS_DEBUG fprintf(stderr, "PacketAlias/Skinny: Received start media trans msg\n"); |