Comparison with an unsigned value (size_t) and < 0

CID 4190 and CID 4191
This commit is contained in:
Philippe Saint-Pierre 2011-11-27 00:21:41 -05:00
parent 20e36f6e64
commit d9a215b71f
1 changed files with 2 additions and 2 deletions

View File

@ -739,7 +739,7 @@ _user_xsi_msgrcv(int messageQueueID, void *messagePointer,
MutexLocker messageQueueLocker(messageQueue->Lock());
messageQueueHashLocker.Unlock();
if (messageSize < 0 || messageSize > MAX_BYTES_PER_QUEUE) {
if (messageSize > MAX_BYTES_PER_QUEUE) {
TRACE_ERROR(("xsi_msgrcv: message size is out of range\n"));
return EINVAL;
}
@ -837,7 +837,7 @@ _user_xsi_msgsnd(int messageQueueID, const void *messagePointer,
MutexLocker messageQueueLocker(messageQueue->Lock());
messageQueueHashLocker.Unlock();
if (messageSize < 0 || messageSize > MAX_BYTES_PER_QUEUE) {
if (messageSize > MAX_BYTES_PER_QUEUE) {
TRACE_ERROR(("xsi_msgsnd: message size is out of range\n"));
return EINVAL;
}