зеркало из https://github.com/mozilla/gecko-dev.git
Bug 338179: Ineffective NULL checks in nsSocket::Send, nsSocket::Recv. Patch by Ehsan Akhgari <ehsan.akhgari@gmail.com>, r=me
This commit is contained in:
Родитель
a055f75497
Коммит
b292993aee
|
@ -288,7 +288,7 @@ nsSocket::Send(unsigned char *aBuf, int *aBufSize)
|
|||
int timeout = 0;
|
||||
fd_set selset;
|
||||
|
||||
if (!aBuf || (aBufSize && (*aBufSize <= 0)) || mFd < 0)
|
||||
if (!aBuf || !aBufSize || (*aBufSize <= 0) || mFd < 0)
|
||||
return E_PARAM;
|
||||
|
||||
while (timeout < kTimeoutThresholdUsecs)
|
||||
|
@ -355,7 +355,7 @@ nsSocket::Recv(unsigned char *aBuf, int *aBufSize, int aTimeoutThresholdUsecs)
|
|||
int bufsize;
|
||||
int timeout;
|
||||
|
||||
if (!aBuf || (aBufSize && (*aBufSize <= 0)) || mFd < 0)
|
||||
if (!aBuf || !aBufSize || (*aBufSize <= 0) || mFd < 0)
|
||||
return E_PARAM;
|
||||
memset(aBuf, 0, *aBufSize);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче