Correct the test for length of data in SSL channel info struct.

This commit is contained in:
nelsonb%netscape.com 2001-09-26 04:22:55 +00:00
Родитель d618f63ba1
Коммит 7cf0e718c5
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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);