diff options
author | TAKAI Kousuke <62541129+t-a-k@users.noreply.github.com> | 2022-03-03 23:09:05 +0900 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-03-05 12:00:47 -0700 |
commit | b4603d09e3b40cd371926f222a143c4adf8a7a38 (patch) | |
tree | 945d81929c9d77fd7eed185ff124f92e01ea1ca6 | |
parent | 61cf68d3b867f5469c24d79f9842d5f54735532f (diff) | |
download | perl-b4603d09e3b40cd371926f222a143c4adf8a7a38.tar.gz |
numeric.c: Fix possible null pointer dereferences
Previous code apparently dereferences a variable initialized to NULL.
-rw-r--r-- | numeric.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -108,14 +108,14 @@ Perl_my_strtod(const char * const s, char **e) { NV result; - char ** end_ptr = NULL; + char * end_ptr; - *end_ptr = my_atof2(s, &result); + end_ptr = my_atof2(s, &result); if (e) { - *e = *end_ptr; + *e = end_ptr; } - if (! *end_ptr) { + if (! end_ptr) { result = 0.0; } |