mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-02 12:39:38 +00:00
VMS getnameinfo() seems to have a bug with returned service string
It seems like it gives back gibberish. If we asked for a numeric service, it's easy to check for a digit in the first position, and if there isn't any, rewrite it using older methods. Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
e8461ee1d1
commit
d40cf9bc9c
@ -58,6 +58,7 @@
|
|||||||
|
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/buffer.h>
|
#include <openssl/buffer.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Throughout this file and bio_lcl.h, the existence of the macro
|
* Throughout this file and bio_lcl.h, the existence of the macro
|
||||||
@ -250,6 +251,16 @@ static int addr_strings(const BIO_ADDR *ap, int numeric,
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* VMS getnameinfo() seems to have a bug, where serv gets filled
|
||||||
|
* with gibberish. We can at least check for digits when flags
|
||||||
|
* has NI_NUMERICSERV enabled
|
||||||
|
*/
|
||||||
|
if ((flags & NI_NUMERICSERV) != 0 && !isdigit(serv[0])) {
|
||||||
|
BIO_snprintf(serv, sizeof(serv), "%d",
|
||||||
|
ntohs(BIO_ADDR_rawport(ap)));
|
||||||
|
}
|
||||||
|
|
||||||
if (hostname)
|
if (hostname)
|
||||||
*hostname = OPENSSL_strdup(host);
|
*hostname = OPENSSL_strdup(host);
|
||||||
if (service)
|
if (service)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user