Welcome! Log In Create A New Profile

Advanced

[njs] Fixed ‘ctx.codepoint’ may be used uninitialized.

This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Anonymous User
June 28, 2024 10:54PM
details: https://hg.nginx.org/njs/rev/f358df45922c
branches:
changeset: 2363:f358df45922c
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Jun 21 17:58:32 2024 -0700
description:
Fixed ‘ctx.codepoint’ may be used uninitialized.

When building by GCC 13 with -O3 and -flto flags the following
warning was reported:
In function ‘njs_utf8_decode’,
inlined from ‘njs_text_encoder_encode_into’ at
src/njs_encoding.c:214:14:
src/njs_utf8.c:191:42: error: ‘ctx.codepoint’ may be used
uninitialized [-Werror=maybe-uninitialized]
191 | ctx->codepoint = (ctx->codepoint << 6) | (c & 0x3F);

diffstat:

src/njs_utf8.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r 146d4699a4c4 -r f358df45922c src/njs_utf8.h
--- a/src/njs_utf8.h Thu Jun 20 17:26:14 2024 -0700
+++ b/src/njs_utf8.h Fri Jun 21 17:58:32 2024 -0700
@@ -128,6 +128,7 @@ njs_utf8_decode_init(njs_unicode_decode_
{
ctx->need = 0x00;
ctx->lower = 0x00;
+ ctx->codepoint = 0;
}


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

[njs] Fixed ‘ctx.codepoint’ may be used uninitialized.

Anonymous User 276 June 28, 2024 10:54PM



Online Users

Guests: 299
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready