зеркало из https://github.com/mozilla/pjs.git
Correct the test for length of data in SSL channel info struct.
This commit is contained in:
Родитель
d618f63ba1
Коммит
7cf0e718c5
|
@ -300,7 +300,7 @@ printSecurityInfo(PRFileDesc *fd)
|
|||
result = SSL_GetChannelInfo(fd, &info, sizeof info);
|
||||
if (result != SECSuccess)
|
||||
return;
|
||||
if (info.length >= sizeof info - sizeof info.reserved) {
|
||||
if (info.length >= offsetof(SSLChannelInfo, reserved)) {
|
||||
FPRINTF(stderr,
|
||||
"selfserv: SSL version %d.%d using %d-bit %s with %d-bit %s MAC\n",
|
||||
info.protocolVersion >> 8, info.protocolVersion & 0xff,
|
||||
|
|
|
@ -263,7 +263,7 @@ printSecurityInfo(PRFileDesc *fd)
|
|||
result = SSL_GetChannelInfo(fd, &info, sizeof info);
|
||||
if (result != SECSuccess)
|
||||
return;
|
||||
if (info.length >= sizeof info - sizeof info.reserved) {
|
||||
if (info.length >= offsetof(SSLChannelInfo, reserved)) {
|
||||
fprintf(stderr,
|
||||
"strsclnt: SSL version %d.%d using %d-bit %s with %d-bit %s MAC\n",
|
||||
info.protocolVersion >> 8, info.protocolVersion & 0xff,
|
||||
|
|
|
@ -136,7 +136,7 @@ void printSecurityInfo(PRFileDesc *fd)
|
|||
result = SSL_GetChannelInfo(fd, &info, sizeof info);
|
||||
if (result != SECSuccess)
|
||||
return;
|
||||
if (info.length >= sizeof info - sizeof info.reserved) {
|
||||
if (info.length >= offsetof(SSLChannelInfo, reserved)) {
|
||||
fprintf(stderr,
|
||||
"SSL version %d.%d using %d-bit %s with %d-bit %s MAC\n",
|
||||
info.protocolVersion >> 8, info.protocolVersion & 0xff,
|
||||
|
@ -557,9 +557,9 @@ int main(int argc, char **argv)
|
|||
if (verbose)
|
||||
SECU_PrintError(progName, "connect");
|
||||
milliPause(50 * multiplier);
|
||||
pollset[0].fd = s;
|
||||
pollset[0].in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
|
||||
pollset[0].out_flags = 0;
|
||||
pollset[0].fd = s;
|
||||
while(1) {
|
||||
PRINTF("%s: about to call PR_Poll for connect completion!\n", progName);
|
||||
filesReady = PR_Poll(pollset, 1, PR_INTERVAL_NO_TIMEOUT);
|
||||
|
|
Загрузка…
Ссылка в новой задаче