Welcome! Log In Create A New Profile

Advanced

[njs] QueryString: avoiding arithmetic ops with NULL in parse().

Dmitry Volyntsev
January 11, 2024 06:16PM
details: https://hg.nginx.org/njs/rev/2b221f44efa6
branches:
changeset: 2266:2b221f44efa6
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Jan 11 15:13:43 2024 -0800
description:
QueryString: avoiding arithmetic ops with NULL in parse().

Found by UndefinedBehaviorSanitizer.

diffstat:

external/njs_query_string_module.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r a5f279148c9f -r 2b221f44efa6 external/njs_query_string_module.c
--- a/external/njs_query_string_module.c Wed Jan 10 16:26:35 2024 -0800
+++ b/external/njs_query_string_module.c Thu Jan 11 15:13:43 2024 -0800
@@ -491,7 +491,7 @@ njs_query_string_parser(njs_vm_t *vm, u_

key = query;

- do {
+ while (key < end) {
if (count++ == max_keys) {
break;
}
@@ -519,8 +519,7 @@ njs_query_string_parser(njs_vm_t *vm, u_
next:

key = part + sep->length;
-
- } while (key < end);
+ }

return NJS_OK;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] QueryString: avoiding arithmetic ops with NULL in parse().

Dmitry Volyntsev 244 January 11, 2024 06:16PM



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

Online Users

Guests: 258
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready