mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-08 20:46:12 +01:00
test for stream size
This commit is contained in:
parent
abc0a8c78a
commit
2b58cc702a
1 changed files with 41 additions and 38 deletions
|
@ -559,7 +559,7 @@ dvc_parseMQTTPacket( XW_DUtilCtxt* dutil, XWEnv xwe, const XP_UCHAR* topic,
|
||||||
XP_LOGFF( "bad message: too short" );
|
XP_LOGFF( "bad message: too short" );
|
||||||
} else if ( proto == PROTO_1 || proto == PROTO_3 ) {
|
} else if ( proto == PROTO_1 || proto == PROTO_3 ) {
|
||||||
MQTTDevID senderID;
|
MQTTDevID senderID;
|
||||||
stream_getBytes( stream, &senderID, sizeof(senderID) );
|
if ( stream_gotBytes( stream, &senderID, sizeof(senderID) ) ) {
|
||||||
senderID = be64toh( senderID );
|
senderID = be64toh( senderID );
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
XP_UCHAR tmp[32];
|
XP_UCHAR tmp[32];
|
||||||
|
@ -601,6 +601,9 @@ dvc_parseMQTTPacket( XW_DUtilCtxt* dutil, XWEnv xwe, const XP_UCHAR* topic,
|
||||||
XP_LOGFF( "unknown command %d; dropping message", cmd );
|
XP_LOGFF( "unknown command %d; dropping message", cmd );
|
||||||
// XP_ASSERT(0);
|
// XP_ASSERT(0);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
XP_LOGFF( "no senderID found; bailing" );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
XP_LOGFF( "bad proto %d; dropping packet", proto );
|
XP_LOGFF( "bad proto %d; dropping packet", proto );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue