Welcome! Log In Create A New Profile

Advanced

[njs] Fixed integer-overflow in ToInt32().

Dmitry Volyntsev
May 24, 2021 10:20AM
details: https://hg.nginx.org/njs/rev/a33a16ec5aa0
branches:
changeset: 1642:a33a16ec5aa0
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Mon May 24 14:17:59 2021 +0000
description:
Fixed integer-overflow in ToInt32().

error: negation of -2147483648 cannot be represented in type 'int32_t'.

Found by OSS-Fuzz.

diffstat:

src/njs_number.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 98f436565ddf -r a33a16ec5aa0 src/njs_number.h
--- a/src/njs_number.h Mon May 24 12:33:43 2021 +0000
+++ b/src/njs_number.h Mon May 24 14:17:59 2021 +0000
@@ -76,7 +76,7 @@ njs_number_to_integer(double num)
njs_inline int32_t
njs_number_to_int32(double num)
{
- int32_t r;
+ uint32_t r;
uint64_t v;
njs_int_t exp;
njs_diyfp_conv_t conv;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fixed integer-overflow in ToInt32().

Dmitry Volyntsev 92 May 24, 2021 10:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready