Skip to content
Snippets Groups Projects
Commit 95412237 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

don't test size/length < 0

parent c6bf9de7
No related branches found
No related tags found
No related merge requests found
......@@ -205,7 +205,6 @@ class GmshSocket{
{
*swap = 0;
if(_ReceiveData(type, sizeof(int)) > 0){
if(*type < 0) return 0;
if(*type > 65535){
// the data comes from a machine with different endianness and
// we must swap the bytes
......@@ -213,7 +212,6 @@ class GmshSocket{
_SwapBytes((char*)type, sizeof(int), 1);
}
if(_ReceiveData(len, sizeof(int)) > 0){
if(*len < 0) return 0;
if(*swap) _SwapBytes((char*)len, sizeof(int), 1);
return 1;
}
......@@ -372,7 +370,7 @@ class GmshServer : public GmshSocket{
#if !defined(WIN32) || defined(__CYGWIN__)
if(tmpsock < 0)
#else
if(tmpsock == (int)INVALID_SOCKET)
if(tmpsock == (int)INVALID_SOCKET)
#endif
throw "Couldn't create socket";
// bind the socket to its name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment