MySQL: Initialize a variable.

Fix

*** CID 1504408:  Uninitialized variables  (UNINIT)
/builds/wireshark/wireshark/epan/dissectors/packet-mysql.c: 2683 in mysql_dissect_ok_packet()
2677     				}
2678     			}
2679     		}
2680     	} else {
2681     		/* optional: message string */
2682     		if (tvb_reported_length_remaining(tvb, offset) > 0) {
>>>     CID 1504408:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "lenstr".
2683     			if(lenstr > (guint64)tvb_reported_length_remaining(tvb, offset))
2684     				lenstr = tvb_reported_length_remaining(tvb, offset);
2685     			proto_tree_add_item(tree, hf_mysql_message, tvb, offset, (gint)lenstr, ENC_ASCII);
2686     			offset += (int)lenstr;
2687     		}
2688     	}
This commit is contained in:
Gerald Combs 2022-05-12 09:39:02 -07:00 committed by A Wireshark GitLab Utility
parent 609c0d3881
commit 909280ce82
1 changed files with 1 additions and 1 deletions

View File

@ -2618,7 +2618,7 @@ static int
mysql_dissect_ok_packet(tvbuff_t *tvb, packet_info *pinfo, int offset,
proto_tree *tree, mysql_conn_data_t *conn_data)
{
guint64 lenstr;
guint64 lenstr = 0;
guint64 affected_rows;
guint64 insert_id;
int fle;