Get Wireshark to compile with afl-gcc.

Fix errors found by American Fuzzy Lop's afl-gcc
(http://lcamtuf.coredump.cx/afl/):

peektagged.c:
error: 'fileVersion' may be used uninitialized in this function

packet-h223.c:
error: variable 'circuit_id' might be clobbered by 'longjmp' or 'vfork'

wslua_proto.c:
error: variable 'd' might be clobbered by 'longjmp' or 'vfork'

wslua_proto.c:
error: variable 'dt' might be clobbered by 'longjmp' or 'vfork'

Change-Id: Idd74a3ad7b236d3a8756c1e7e917b1c74143f381
Reviewed-on: https://code.wireshark.org/review/6767
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2015-01-24 10:28:56 -08:00
parent 7ed097c06a
commit cf142c6b67
3 changed files with 5 additions and 5 deletions

View File

@ -744,12 +744,12 @@ dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo,
{
/* update the circuit details before passing to a subdissector */
circuit_type ctype = CT_H223;
guint32 circuit_id = circuit_chain_lookup(call_info, vc);
/* XXX - Not sure if these need to be saved */
pinfo->circuit_id = circuit_id;
pinfo->circuit_id = circuit_chain_lookup(call_info, vc);
pinfo->ctype = ctype;
TRY {
guint32 circuit_id = pinfo->circuit_id;
circuit_t *subcircuit=find_circuit(ctype,circuit_id,pinfo->fd->num);
proto_tree *vc_tree = NULL;
proto_item *vc_item;

View File

@ -2128,7 +2128,7 @@ WSLUA_METHOD Dissector_call(lua_State* L) {
#define WSLUA_ARG_Dissector_call_PINFO 3 /* The packet info. */
#define WSLUA_ARG_Dissector_call_TREE 4 /* The tree on which to add the protocol items. */
Dissector d = checkDissector(L,1);
Dissector volatile d = checkDissector(L,1);
Tvb tvb = checkTvb(L,WSLUA_ARG_Dissector_call_TVB);
Pinfo pinfo = checkPinfo(L,WSLUA_ARG_Dissector_call_PINFO);
TreeItem ti = checkTreeItem(L,WSLUA_ARG_Dissector_call_TREE);
@ -2539,7 +2539,7 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) {
#define WSLUA_ARG_DissectorTable_try_TVB 3 /* The buffer to dissect. */
#define WSLUA_ARG_DissectorTable_try_PINFO 4 /* The packet info. */
#define WSLUA_ARG_DissectorTable_try_TREE 5 /* The tree on which to add the protocol items. */
DissectorTable dt = checkDissectorTable(L,1);
DissectorTable volatile dt = checkDissectorTable(L,1);
Tvb tvb = checkTvb(L,WSLUA_ARG_DissectorTable_try_TVB);
Pinfo pinfo = checkPinfo(L,WSLUA_ARG_DissectorTable_try_PINFO);
TreeItem ti = checkTreeItem(L,WSLUA_ARG_DissectorTable_try_TREE);

View File

@ -311,7 +311,7 @@ wtap_open_return_val peektagged_open(wtap *wth, int *err, gchar **err_info)
{
peektagged_section_header_t ap_hdr;
int ret;
guint32 fileVersion;
guint32 fileVersion = 0;
guint32 mediaType;
guint32 mediaSubType = 0;
int file_encap;