forked from osmocom/wireshark
f2b4daf400
The WRETH dissector showed up some garbage in the column display. Upon further inspection, it turns out that the format string had a trailing percent sign which caused (unsigned)-1 to be returned by g_printf_string_upper_bound (in emem_strdup_vprintf). Then ep_alloc is called with (unsigned)-1 + 1 = 0 memory, no wonder that garbage shows up. ASAN could not even catch this error because EP is in charge of this. So, start adding G_GNUC_PRINTF annotations in each header that uses the "fmt" or "format" paramters (grepped + awk). This revealed some other errors. The NCP2222 dissector was missing a format string (not a security vuln though). Many dissectors used val_to_str with a constant (but empty) string, these have been replaced by val_to_str_const. ASN.1 dissectors were regenerated for this. Minor: the mate plugin used "%X" instead of "%p" for a pointer type. The ncp2222 dissector and wimax plugin gained modelines. Change-Id: I7f3f6a3136116f9b251719830a39a7b21646f622 Reviewed-on: https://code.wireshark.org/review/2881 Reviewed-by: Evan Huus <eapache@gmail.com>
121 lines
2.8 KiB
INI
121 lines
2.8 KiB
INI
#.PDU_NEW
|
|
|
|
ROS
|
|
|
|
#.OMIT_ASSIGNMENT
|
|
|
|
Priority
|
|
RejectProblem
|
|
Components
|
|
GFPInvokeIDSet
|
|
|
|
#.TYPE_RENAME
|
|
|
|
Invoke/argument InvokeArgument
|
|
ReturnResult/result/result ResultArgument
|
|
|
|
#.FIELD_RENAME
|
|
|
|
Invoke/linkedId/present linkedIdPresent
|
|
|
|
Reject/problem/invoke invokeProblem
|
|
Reject/problem/returnError returnErrorProblem
|
|
Reject/problem/returnResult returnResultProblem
|
|
|
|
ReturnResult/result/result resultArgument
|
|
|
|
#--- ROS ---
|
|
|
|
#.FN_HDR ROS
|
|
/* will be moved to ROS_PDU when PDU function can be alternated from conformance file */
|
|
actx->rose_ctx = rose_ctx_tmp;
|
|
rose_ctx_clean_data(actx->rose_ctx);
|
|
#.END
|
|
|
|
#--- Code ---
|
|
|
|
#.FN_PARS
|
|
Code VAL_PTR = &%(ACTX)s->rose_ctx->d.code
|
|
Code/local VAL_PTR = &%(ACTX)s->rose_ctx->d.code_local
|
|
Code/global FN_VARIANT = _str VAL_PTR = &%(ACTX)s->rose_ctx->d.code_global
|
|
#.FN_FTR Code
|
|
actx->rose_ctx->d.code_item = actx->created_item;
|
|
#.END
|
|
|
|
#--- Problem ---
|
|
|
|
#.FN_PARS
|
|
GeneralProblem VAL_PTR = &problem_val
|
|
InvokeProblem VAL_PTR = &problem_val
|
|
ReturnResultProblem VAL_PTR = &problem_val
|
|
ReturnErrorProblem VAL_PTR = &problem_val
|
|
#.FN_FTR GeneralProblem
|
|
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_GeneralProblem_vals), ""), 64);
|
|
#.FN_FTR InvokeProblem
|
|
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_InvokeProblem_vals), ""), 64);
|
|
#.FN_FTR ReturnResultProblem
|
|
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""), 64);
|
|
#.FN_FTR ReturnErrorProblem
|
|
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
|
|
#.END
|
|
|
|
#--- INVOKE ---
|
|
|
|
#.FIELD_ATTR
|
|
Invoke/argument TYPE = FT_BYTES DISPLAY = BASE_NONE
|
|
|
|
#.FN_BODY Invoke/argument
|
|
gint len;
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
if (len)
|
|
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
|
|
arg_next_tvb = tvb_new_subset_remaining(tvb, offset);
|
|
|
|
offset += tvb_length_remaining(tvb, offset);
|
|
#.END
|
|
|
|
#.INCLUDE ../ros/ros-inv.cnf
|
|
|
|
#--- RETURN RESULT ---
|
|
|
|
#.FIELD_ATTR
|
|
ReturnResult/result/result TYPE = FT_BYTES DISPLAY = BASE_NONE
|
|
|
|
#.FN_BODY ReturnResult/result/result
|
|
gint len;
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
if (len)
|
|
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
|
|
res_next_tvb = tvb_new_subset_remaining(tvb, offset);
|
|
|
|
offset += tvb_length_remaining(tvb, offset);
|
|
|
|
#.END
|
|
|
|
#.INCLUDE ../ros/ros-res.cnf
|
|
|
|
#--- RETURN ERROR ---
|
|
|
|
#.FIELD_ATTR
|
|
ReturnError/parameter TYPE = FT_BYTES DISPLAY = BASE_NONE
|
|
|
|
#.FN_BODY ReturnError/parameter
|
|
|
|
gint len;
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
if (len)
|
|
proto_tree_add_item(tree, hf_index, tvb, offset, len, ENC_NA);
|
|
err_next_tvb = tvb_new_subset_remaining(tvb, offset);
|
|
|
|
offset += tvb_length_remaining(tvb, offset);
|
|
#.END
|
|
|
|
#.INCLUDE ../ros/ros-err.cnf
|
|
|
|
#--- REJECT ---
|
|
|
|
#.INCLUDE ../ros/ros-rej.cnf
|