Skip to content

Commit f482695

Browse files
author
Mikhail Galanin
committed
Avoid using uninitialised struct
1 parent 81faab9 commit f482695

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/mysqlnd/mysqlnd_result.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
172172
enum_func_status ret;
173173
MYSQLND_STMT_DATA * stmt = s ? s->data : NULL;
174174
MYSQLND_PACKET_RSET_HEADER rset_header;
175-
MYSQLND_PACKET_EOF fields_eof;
175+
MYSQLND_PACKET_EOF fields_eof = {0};
176176

177177
DBG_ENTER("mysqlnd_query_read_result_set_header");
178178
DBG_INF_FMT("stmt=" ZEND_ULONG_FMT, stmt? stmt->stmt_id:0);

ext/mysqlnd/mysqlnd_wireprotocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PHPAPI extern const char mysqlnd_read_body_name[];
3434
#define PACKET_FREE(packet) \
3535
do { \
3636
DBG_INF_FMT("PACKET_FREE(%p)", packet); \
37-
if ((packet)->header.m->free_mem) { \
37+
if ((packet)->header.m && (packet)->header.m->free_mem) { \
3838
((packet)->header.m->free_mem((packet))); \
3939
} \
4040
} while (0);

0 commit comments

Comments
 (0)