diff options
author | jsing <> | 2014-06-22 14:41:10 +0000 |
---|---|---|
committer | jsing <> | 2014-06-22 14:41:10 +0000 |
commit | 0e48583e384b473bddadeed479e2ac76911814bc (patch) | |
tree | a48d59c793ed018ac1b68d77e5b9dc0708d3bc84 /src/lib/libcrypto/bio/bio_err.c | |
parent | fc342088a9e9234b5e22294af9d7a3b490705097 (diff) | |
download | openbsd-0e48583e384b473bddadeed479e2ac76911814bc.tar.gz openbsd-0e48583e384b473bddadeed479e2ac76911814bc.tar.bz2 openbsd-0e48583e384b473bddadeed479e2ac76911814bc.zip |
In BIO_get_port(), use strol() with appropriate range checks rather than
an atoi() followed by an unsigned short cast. This stops things like "-1"
and "66536" from being considered to be "valid" port numbers.
ok beck@ deraadt@
Diffstat (limited to 'src/lib/libcrypto/bio/bio_err.c')
-rw-r--r-- | src/lib/libcrypto/bio/bio_err.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bio/bio_err.c b/src/lib/libcrypto/bio/bio_err.c index e6bf958b6e..8307c1099f 100644 --- a/src/lib/libcrypto/bio/bio_err.c +++ b/src/lib/libcrypto/bio/bio_err.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bio_err.c,v 1.14 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: bio_err.c,v 1.15 2014/06/22 14:41:10 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -118,6 +118,7 @@ static ERR_STRING_DATA BIO_str_reasons[] = { | |||
118 | {ERR_REASON(BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET), "gethostbyname addr is not af inet"}, | 118 | {ERR_REASON(BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET), "gethostbyname addr is not af inet"}, |
119 | {ERR_REASON(BIO_R_INVALID_ARGUMENT) , "invalid argument"}, | 119 | {ERR_REASON(BIO_R_INVALID_ARGUMENT) , "invalid argument"}, |
120 | {ERR_REASON(BIO_R_INVALID_IP_ADDRESS) , "invalid ip address"}, | 120 | {ERR_REASON(BIO_R_INVALID_IP_ADDRESS) , "invalid ip address"}, |
121 | {ERR_REASON(BIO_R_INVALID_PORT_NUMBER) , "invalid port number"}, | ||
121 | {ERR_REASON(BIO_R_IN_USE) , "in use"}, | 122 | {ERR_REASON(BIO_R_IN_USE) , "in use"}, |
122 | {ERR_REASON(BIO_R_KEEPALIVE) , "keepalive"}, | 123 | {ERR_REASON(BIO_R_KEEPALIVE) , "keepalive"}, |
123 | {ERR_REASON(BIO_R_NBIO_CONNECT_ERROR) , "nbio connect error"}, | 124 | {ERR_REASON(BIO_R_NBIO_CONNECT_ERROR) , "nbio connect error"}, |