diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-08-21 20:05:24 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-08-21 20:05:24 +0000 |
commit | 758c81485d816de9fbf76889979e6bd853f118dd (patch) | |
tree | ed8fe0011a66d22f9e277992cd7f7f92310e2725 /orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp | |
parent | 4d379dedb4894c89d8ce13ccd313e027cb5459a8 (diff) |
Adjusted the CCM5 packet parser to assume that Ccm5CallInfo packets have parties section of variable length.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@556 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp index 660fd08..1e25a2a 100644 --- a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp +++ b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.cpp @@ -154,6 +154,7 @@ bool SkinnyValidateCallInfo(SkCallInfoStruct* sci, u_char* packetEnd) bool SkinnyValidateCcm5CallInfo(SkCcm5CallInfoStruct *sci, u_char* packetEnd) { + int partiesLen = 0; bool valid = true; if(((u_char*)sci + sizeof(SkCcm5CallInfoStruct)) > packetEnd) { @@ -163,19 +164,23 @@ bool SkinnyValidateCcm5CallInfo(SkCcm5CallInfoStruct *sci, u_char* packetEnd) { valid = false; } + partiesLen = (int)packetEnd - (int)sci - sizeof(SkCcm5CallInfoStruct); if(valid) { - valid = checkPartyString(sci->parties, SKINNY_CCM5_PARTIES_BLOCK_SIZE); + valid = checkPartyString(sci->parties, partiesLen); } if(valid) { // Find the first null char separating the calling and called parties (at this point, we know there's one) char* nullChar = (char*)&sci->parties; + int skip = 0; while(*nullChar != '\0') { nullChar++; + skip++; } - valid = checkPartyString(nullChar+1, SKINNY_CCM5_PARTIES_BLOCK_SIZE); + skip += 1; + valid = checkPartyString(nullChar+1, (partiesLen - skip)); } return valid; } |