Check for NULL conf in NCONF_get_number
authorPauli <paul.dale@oracle.com>
Mon, 2 Jul 2018 22:02:37 +0000 (08:02 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 3 Jul 2018 03:14:17 +0000 (13:14 +1000)
commitc36b39b5cd685fc5eae84ece247e7873a27d8834
tree1aa8ed67628754752229c02b84c1c489b0354839
parent3bb5e5b09e32defefda2b61087c113203005ffa0
Check for NULL conf in NCONF_get_number

The problematic case falls back to a NULL conf which returns the result
of getenv(2).  If this returns NULL, everything was good.  If this returns
a string an attempt to convert it to a number is made using the function
pointers from conf.

This fix uses the strtol(3) function instead, we don't have the
configuration settings and this behaves as the default would.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6632)
crypto/conf/conf_lib.c
test/conf_include_test.c