Skip to content

Commit ac8d113

Browse files
bneradtbneradt
andauthored
ts_lua_transform: input_reader may be used uninitialized (#10297)
Fix: ``` plugins/lua/ts_lua_transform.cc: In function ‘int ts_lua_client_entry(tsapi::c::TSCont, tsapi::c::TSEvent, void*)’: plugins/lua/ts_lua_transform.cc:136:28: error: ‘input_reader’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 136 | TSIOBufferReaderConsume(input_reader, input_avail); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ plugins/lua/ts_lua_transform.cc:62:20: note: ‘input_reader’ was declared here 62 | TSIOBufferReader input_reader; | ^~~~~~~~~~~~ mv -f esi/.deps/esi_la-esi.Tpo esi/.deps/esi_la-esi.Plo plugins/lua/ts_lua_transform.cc: In function ‘int ts_lua_transform_entry(tsapi::c::TSCont, tsapi::c::TSEvent, void*)’: plugins/lua/ts_lua_transform.cc:373:28: error: ‘input_reader’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 373 | TSIOBufferReaderConsume(input_reader, input_avail); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ plugins/lua/ts_lua_transform.cc:289:20: note: ‘input_reader’ was declared here 289 | TSIOBufferReader input_reader; | ^~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[2]: *** [Makefile:6725: lua/tslua_la-ts_lua_transform.lo] Error 1 ``` Co-authored-by: bneradt <bneradt@yahooinc.com>
1 parent 3269bdc commit ac8d113

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/lua/ts_lua_transform.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int
5959
ts_lua_client_handler(TSCont contp, ts_lua_http_transform_ctx *transform_ctx, TSEvent event, int n)
6060
{
6161
TSVIO input_vio;
62-
TSIOBufferReader input_reader;
62+
TSIOBufferReader input_reader = nullptr;
6363
TSIOBufferBlock blk;
6464
int64_t toread, towrite, blk_len, upstream_done, input_avail, input_wm_bytes;
6565
const char *start;
@@ -286,7 +286,7 @@ ts_lua_transform_handler(TSCont contp, ts_lua_http_transform_ctx *transform_ctx,
286286
{
287287
TSVConn output_conn;
288288
TSVIO input_vio;
289-
TSIOBufferReader input_reader;
289+
TSIOBufferReader input_reader = nullptr;
290290
TSIOBufferBlock blk;
291291
int64_t toread, towrite, blk_len, upstream_done, input_avail, input_wm_bytes, l;
292292
const char *start;

0 commit comments

Comments
 (0)