Dear Sir:<br><br>In RTPInterface::handleRead(), the following code may cause vulnerabilities due to type inconsistency:<br><br>Boolean RTPInterface::handleRead(unsigned char* buffer,<br> unsigned bufferMaxSize,<br>
unsigned& bytesRead,<br> struct sockaddr_in& fromAddress) {<br><br>......<br><br> unsigned curBytesRead;<br> while ((curBytesRead = readSocket(envir(), fNextTCPReadStreamSocketNum,<br> &buffer[bytesRead], curBytesToRead,<br>
fromAddress)) > 0) {<br> bytesRead += curBytesRead;<br> if (bytesRead >= totBytesToRead) break;<br> curBytesToRead -= curBytesRead;<br> }<br> if (curBytesRead <= 0) {<br> bytesRead = 0;<br>
readSuccess = False;<br> RTPOverTCP_OK = False; // HACK #####<br> } else {<br> readSuccess = True;<br> }<br><br>.......<br><br>}<br><br>Here, ReadSocket() returns int while curBytesRead is declared unsigned. If ReadSocket() returns -1, the above code may cause problem.<br>
<br>BR.<br>Brain Lai<br>