Add printf-format annotations, fix garbage

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>
This commit is contained in:
Peter Wu 2014-07-06 15:34:38 +02:00 committed by Evan Huus
parent ec6a22dc3b
commit f2b4daf400
28 changed files with 97 additions and 57 deletions

View File

@ -47,16 +47,16 @@ 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(problem_val, VALS(h450_ros_GeneralProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_GeneralProblem_vals), ""), 64);
problem_str[64-1] = '\0';
#.FN_FTR InvokeProblem
g_strlcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_InvokeProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_InvokeProblem_vals), ""), 64);
problem_str[64-1] = '\0';
#.FN_FTR ReturnResultProblem
g_strlcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_ReturnResultProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_ReturnResultProblem_vals), ""), 64);
problem_str[64-1] = '\0';
#.FN_FTR ReturnErrorProblem
g_strlcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_ReturnErrorProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_ReturnErrorProblem_vals), ""), 64);
problem_str[64-1] = '\0';
#.END

View File

@ -50,13 +50,13 @@ 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(problem_val, VALS(q932_ros_GeneralProblem_vals), ""), 64);
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(problem_val, VALS(q932_ros_InvokeProblem_vals), ""), 64);
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(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""), 64);
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(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
#.END
#--- INVOKE ---

View File

@ -208,7 +208,7 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
proto_item_append_text(tree, " (%%s)", name);
}
if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
if((fmt = val_to_str_const(hf_index, fmt_vals, "")) && *fmt) {
/* we have a format */
last_ava = (char *)wmem_alloc(wmem_packet_scope(), MAX_AVA_STR_LEN); *last_ava = '\0';
register_frame_end_routine (actx->pinfo, x509if_frame_end);
@ -251,7 +251,7 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
proto_item_append_text(tree, "%%s)", value);
}
if((fmt = val_to_str(ava_hf_index, fmt_vals, "")) && *fmt) {
if((fmt = val_to_str_const(ava_hf_index, fmt_vals, "")) && *fmt) {
/* we have a format */
if (!last_ava) {
@ -384,7 +384,7 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
proto_item_append_text(top_of_dn, " (%%s)", last_dn);
/* see if we should append this to the col info */
if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
if((fmt = val_to_str_const(hf_index, fmt_vals, "")) && *fmt) {
/* we have a format */
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s%%s", fmt, last_dn);
}

View File

@ -167,7 +167,7 @@ extern echld_bool_t paramset_apply_set (param_t* paramsets, char* name, char* va
extern echld_bool_t paramset_apply_em(param_t* paramset, enc_msg_t* em, char** err);
#define PARAM_LIST_FMT "%s(%s): %s\n" /* name, rw|ro|wo, desc */
char* paramset_get_params_list(param_t* paramsets,const char* fmt);
char* paramset_get_params_list(param_t* paramsets, const char* fmt) G_GNUC_PRINTF(2, 0);
#define PARAM_STR(Name, Default) static char* param_ ## Name = Default; \
static char* param_get_ ## Name (char** err _U_ ) { return (param_ ## Name) ? g_strdup(param_ ## Name) : (*err = g_strdup( #Name " not set"), NULL); } \

View File

@ -188,7 +188,9 @@ WS_DLL_PUBLIC enc_msg_t* echld_new_child_params_merge(enc_msg_t*, enc_msg_t*);
#define ECHLD_NC_PARAMS_FMT " %s='%s',\n" /* param='value' */
/* truncate takes off last N chars from the last item's fmt or prefix on empty */
WS_DLL_PUBLIC char* echld_new_child_params_str(enc_msg_t* em, const char* prefix, const char* postfix, int truncate, const char* fmt);
WS_DLL_PUBLIC char* echld_new_child_params_str(enc_msg_t* em,
const char* prefix, const char* postfix, int truncate, const char* fmt)
G_GNUC_FORMAT(5, 0);
/* create a new worker process */

View File

@ -68,7 +68,7 @@ extern stnode_t *df_lval;
/* Set dfilter_error_msg_buf and dfilter_error_msg */
void
dfilter_fail(const char *format, ...);
dfilter_fail(const char *format, ...) G_GNUC_PRINTF(1, 2);
void
DfilterTrace(FILE *TraceFILE, char *zTracePrompt);

View File

@ -81,11 +81,11 @@ any "error" symbols are shifted, if possible. */
break;
case STTYPE_STRING:
dfilter_fail("The string \"%s\" was unexpected in this context.",
stnode_data(TOKEN));
(char *)stnode_data(TOKEN));
break;
case STTYPE_UNPARSED:
dfilter_fail("\"%s\" was unexpected in this context.",
stnode_data(TOKEN));
(char *)stnode_data(TOKEN));
break;
case STTYPE_INTEGER:
dfilter_fail("The integer %d was unexpected in this context.",

View File

@ -358,7 +358,7 @@ check_exists(stnode_t *st_arg1)
case STTYPE_STRING:
case STTYPE_UNPARSED:
dfilter_fail("\"%s\" is neither a field nor a protocol name.",
stnode_data(st_arg1));
(char *)stnode_data(st_arg1));
THROW(TypeError);
break;
@ -730,8 +730,8 @@ check_relation_LHS_STRING(const char* relation_string,
else if (type2 == STTYPE_STRING || type2 == STTYPE_UNPARSED) {
/* Well now that's silly... */
dfilter_fail("Neither \"%s\" nor \"%s\" are field or protocol names.",
stnode_data(st_arg1),
stnode_data(st_arg2));
(char *)stnode_data(st_arg1),
(char *)stnode_data(st_arg2));
THROW(TypeError);
}
else if (type2 == STTYPE_RANGE) {
@ -819,8 +819,8 @@ check_relation_LHS_UNPARSED(const char* relation_string,
else if (type2 == STTYPE_STRING || type2 == STTYPE_UNPARSED) {
/* Well now that's silly... */
dfilter_fail("Neither \"%s\" nor \"%s\" are field or protocol names.",
stnode_data(st_arg1),
stnode_data(st_arg2));
(char *)stnode_data(st_arg1),
(char *)stnode_data(st_arg2));
THROW(TypeError);
}
else if (type2 == STTYPE_RANGE) {

View File

@ -111,7 +111,7 @@ static ddict_xmlpi_t* last_xmlpi;
static char** attr_str;
static unsigned* attr_uint;
static void ddict_debug(const char* fmt, ...);
static void ddict_debug(const char* fmt, ...) G_GNUC_PRINTF(1, 2);
static void append_to_buffer(const char* txt, unsigned len);
static FILE* ddict_open(const char*, const char*);

View File

@ -5125,7 +5125,7 @@ static int dissect_DIS_PARSER_SIGNAL_PDU(tvbuff_t *tvb, packet_info *pinfo, prot
offset = parse_DIS_FIELDS_SIGNAL_LINK16_NETWORK_HEADER(tvb, tree, offset, &messageType);
ti = proto_tree_add_text(tree, tvb, offset, -1, "Link 16 Message Data: %s",
val_to_str(messageType, DIS_PDU_Link16_MessageType_Strings, ""));
val_to_str_const(messageType, DIS_PDU_Link16_MessageType_Strings, ""));
sub_tree = proto_item_add_subtree(ti, ett_dis_signal_link16_message_data);
offset = parse_Link16_Message_Data(sub_tree, tvb, offset, pinfo, encodingScheme, messageType);
proto_item_set_end(ti, tvb, offset);

View File

@ -422,7 +422,7 @@ dissect_h450_ros_GeneralProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
#line 50 "../../asn1/h450-ros/h450-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_GeneralProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_GeneralProblem_vals), ""), 64);
problem_str[64-1] = '\0';
return offset;
@ -447,7 +447,7 @@ dissect_h450_ros_InvokeProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
#line 53 "../../asn1/h450-ros/h450-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_InvokeProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_InvokeProblem_vals), ""), 64);
problem_str[64-1] = '\0';
return offset;
@ -467,7 +467,7 @@ dissect_h450_ros_ReturnResultProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
#line 56 "../../asn1/h450-ros/h450-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_ReturnResultProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_ReturnResultProblem_vals), ""), 64);
problem_str[64-1] = '\0';
return offset;
@ -489,7 +489,7 @@ dissect_h450_ros_ReturnErrorProblem(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, &problem_val);
#line 59 "../../asn1/h450-ros/h450-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(h450_ros_ReturnErrorProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(h450_ros_ReturnErrorProblem_vals), ""), 64);
problem_str[64-1] = '\0';
return offset;

View File

@ -1019,9 +1019,9 @@ dissect_lcaf_geo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offse
offset += 1;
proto_item_append_text(ti_lat, ": %s %d\302\260 %d' %d\"",
val_to_str(north, lat_typevals, ""), deg, min, sec);
val_to_str_const(north, lat_typevals, ""), deg, min, sec);
proto_item_append_text(tir, ": (%s%d\302\260%d'%d\"",
val_to_str(north, lat_typevals, ""), deg, min, sec);
val_to_str_const(north, lat_typevals, ""), deg, min, sec);
/* PROCESS LONGITUDE */
@ -1056,9 +1056,9 @@ dissect_lcaf_geo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offse
offset += 1;
proto_item_append_text(ti_lon, ": %s %d\302\260 %d' %d\"",
val_to_str(east, lon_typevals, ""), deg, min, sec);
val_to_str_const(east, lon_typevals, ""), deg, min, sec);
proto_item_append_text(tir, ", %s%d\302\260%d'%d\")",
val_to_str(east, lon_typevals, ""), deg, min, sec);
val_to_str_const(east, lon_typevals, ""), deg, min, sec);
/* PROCESS ALTITUDE */

View File

@ -2855,6 +2855,7 @@ trap_for_expert_event(proto_tree *ncp_tree, packet_info *pinfo, const ncp_record
}
expert_add_info_format(pinfo, NULL, &ei_ncp_file_rights,
"Op-lock open, mode %s for filename %s with rights %s",
val_to_str((guint32)(strtoul(oaction, NULL, 16) & 0xeb), open_create_mode_vals, "Unknown: %d"),
p_filename,
val_to_str((atoi(p_rights) & 0x5f), ncp_rights_vals, "Unknown: %d"));
@ -12062,3 +12063,16 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
CLEANUP_CALL_AND_POP;
}
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=4 expandtab filetype=c:
* :indentSize=4:tabSize=4:noTabs=true:
*/

View File

@ -507,7 +507,7 @@ dissect_q932_ros_GeneralProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
&problem_val);
#line 53 "../../asn1/q932-ros/q932-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_GeneralProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_GeneralProblem_vals), ""), 64);
return offset;
}
@ -532,7 +532,7 @@ dissect_q932_ros_InvokeProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
&problem_val);
#line 55 "../../asn1/q932-ros/q932-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_InvokeProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_InvokeProblem_vals), ""), 64);
return offset;
}
@ -552,7 +552,7 @@ dissect_q932_ros_ReturnResultProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U
&problem_val);
#line 57 "../../asn1/q932-ros/q932-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""), 64);
return offset;
}
@ -574,7 +574,7 @@ dissect_q932_ros_ReturnErrorProblem(gboolean implicit_tag _U_, tvbuff_t *tvb _U_
&problem_val);
#line 59 "../../asn1/q932-ros/q932-ros.cnf"
g_strlcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
g_strlcpy(problem_str, val_to_str_const(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""), 64);
return offset;
}

View File

@ -1182,7 +1182,7 @@ gint WrethMailDissection(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, prot
col_add_fstr(pInfo->cinfo, COL_INFO, "Mail : Codef = Ox%X (%s), Status = %02d (%s), Card = %d, Chan = %d" ,
Codef,
val_to_str_ext(Codef, &tabCodef_ext, "Unknown 0x%04x%"),
val_to_str_ext(Codef, &tabCodef_ext, "Unknown 0x%04x"),
Status,
val_to_str_ext(Status, &tabStatus_ext, "Unknown %d"),
Card,

View File

@ -744,7 +744,7 @@ dissect_x509if_T_type_02(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
proto_item_append_text(tree, " (%s)", name);
}
if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
if((fmt = val_to_str_const(hf_index, fmt_vals, "")) && *fmt) {
/* we have a format */
last_ava = (char *)wmem_alloc(wmem_packet_scope(), MAX_AVA_STR_LEN); *last_ava = '\0';
register_frame_end_routine (actx->pinfo, x509if_frame_end);
@ -796,7 +796,7 @@ dissect_x509if_T_atadv_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
proto_item_append_text(tree, "%s)", value);
}
if((fmt = val_to_str(ava_hf_index, fmt_vals, "")) && *fmt) {
if((fmt = val_to_str_const(ava_hf_index, fmt_vals, "")) && *fmt) {
/* we have a format */
if (!last_ava) {
@ -985,7 +985,7 @@ dissect_x509if_RDNSequence(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
proto_item_append_text(top_of_dn, " (%s)", last_dn);
/* see if we should append this to the col info */
if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
if((fmt = val_to_str_const(hf_index, fmt_vals, "")) && *fmt) {
/* we have a format */
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s%s", fmt, last_dn);
}

View File

@ -853,7 +853,7 @@ dissect_zbee_aps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
/* Display the profile ID now that the source endpoint was listed. */
if (packet.type == ZBEE_APS_FCF_DATA) {
col_append_fstr(pinfo->cinfo, COL_PROTOCOL, " %s",
rval_to_str(packet.profile, zbee_aps_apid_abbrs, ""));
rval_to_str_const(packet.profile, zbee_aps_apid_abbrs, ""));
}
/* Jump here if there is no endpoint addressing in this frame. */

View File

@ -75,10 +75,11 @@ void* ep_memdup(const void* src, size_t len) G_GNUC_MALLOC;
/** Create a formatted string with a packet lifetime scope */
WS_DLL_PUBLIC
gchar* ep_strdup_vprintf(const gchar* fmt, va_list ap) G_GNUC_MALLOC;
gchar* ep_strdup_vprintf(const gchar* fmt, va_list ap)
G_GNUC_MALLOC G_GNUC_PRINTF(1, 0);
WS_DLL_PUBLIC
gchar* ep_strdup_printf(const gchar* fmt, ...)
G_GNUC_MALLOC G_GNUC_PRINTF(1, 2);
G_GNUC_MALLOC G_GNUC_PRINTF(1, 2);
WS_DLL_PUBLIC
gchar *ep_strconcat(const gchar *string, ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;

View File

@ -95,7 +95,8 @@ WS_DLL_PUBLIC void except_deinit(void);
WS_DLL_PUBLIC WS_MSVC_NORETURN void except_rethrow(except_t *) G_GNUC_NORETURN;
WS_DLL_PUBLIC WS_MSVC_NORETURN void except_throw(long, long, const char *) G_GNUC_NORETURN;
WS_DLL_PUBLIC WS_MSVC_NORETURN void except_throwd(long, long, const char *, void *) G_GNUC_NORETURN;
WS_DLL_PUBLIC WS_MSVC_NORETURN void except_throwf(long, long, const char *, ...) G_GNUC_NORETURN;
WS_DLL_PUBLIC WS_MSVC_NORETURN void except_throwf(long, long, const char *, ...)
G_GNUC_NORETURN G_GNUC_PRINTF(3, 4);
WS_DLL_PUBLIC void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *);
extern unsigned long except_code(except_t *);
extern unsigned long except_group(except_t *);

View File

@ -877,7 +877,8 @@ proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, co
@return the newly created item */
proto_item *
proto_tree_add_text_valist(proto_tree *tree, tvbuff_t *tvb, gint start,
gint length, const char *format, va_list ap);
gint length, const char *format, va_list ap)
G_GNUC_PRINTF(5, 0);
/** Add a text-only node that creates a subtree underneath.
proto_tree_add_text + proto_item_add_subtree

View File

@ -111,7 +111,8 @@ ptvcursor_add_with_subtree(ptvcursor_t* ptvc, int hfindex, gint length,
WS_DLL_PUBLIC
proto_tree*
ptvcursor_add_text_with_subtree(ptvcursor_t* ptvc, gint length,
gint ett_subtree, const char* format, ...);
gint ett_subtree, const char* format, ...)
G_GNUC_PRINTF(4, 5);
/* Creates a subtree and adds it to the cursor as the working tree but does not
* save the old working tree */

View File

@ -99,7 +99,7 @@ WS_DLL_PUBLIC char *other_decode_bitfield_value(char *buf, const guint32 val, co
WS_DLL_PUBLIC char *decode_bitfield_value(char *buf, const guint32 val, const guint32 mask,
const int width);
WS_DLL_PUBLIC const char *decode_numeric_bitfield(const guint32 val, const guint32 mask, const int width,
const char *fmt);
const char *fmt) G_GNUC_PRINTF(4, 0);
WS_DLL_PUBLIC const gchar* port_type_to_str (port_type type);

View File

@ -113,7 +113,8 @@ enum { \
WS_DLL_PUBLIC
const gchar *
val_to_str(const guint32 val, const value_string *vs, const char *fmt);
val_to_str(const guint32 val, const value_string *vs, const char *fmt)
G_GNUC_PRINTF(3, 0);
WS_DLL_PUBLIC
const gchar *
@ -136,7 +137,8 @@ typedef struct _val64_string {
WS_DLL_PUBLIC
const gchar *
val64_to_str(const guint64 val, const val64_string *vs, const char *fmt);
val64_to_str(const guint64 val, const val64_string *vs, const char *fmt)
G_GNUC_PRINTF(3, 0);
WS_DLL_PUBLIC
const gchar *
@ -193,7 +195,8 @@ value_string_ext_free(const value_string_ext *vse);
WS_DLL_PUBLIC
const gchar *
val_to_str_ext(const guint32 val, const value_string_ext *vs, const char *fmt);
val_to_str_ext(const guint32 val, const value_string_ext *vs, const char *fmt)
G_GNUC_PRINTF(3, 0);
WS_DLL_PUBLIC
const gchar *
@ -216,7 +219,8 @@ typedef struct _string_string {
WS_DLL_PUBLIC
const gchar *
str_to_str(const gchar *val, const string_string *vs, const char *fmt);
str_to_str(const gchar *val, const string_string *vs, const char *fmt)
G_GNUC_PRINTF(3, 0);
WS_DLL_PUBLIC
const gchar *
@ -236,7 +240,8 @@ typedef struct _range_string {
WS_DLL_PUBLIC
const gchar *
rval_to_str(const guint32 val, const range_string *rs, const char *fmt);
rval_to_str(const guint32 val, const range_string *rs, const char *fmt)
G_GNUC_PRINTF(3, 0);
WS_DLL_PUBLIC
const gchar *

View File

@ -210,7 +210,7 @@ static mate_gop* new_gop(mate_cfg_gop* cfg, mate_pdu* pdu, gchar* key) {
}
static void adopt_gop(mate_gog* gog, mate_gop* gop) {
dbg_print (dbg_gog,5,dbg_facility,"adopt_gop: gog=%X gop=%X",gog,gop);
dbg_print (dbg_gog,5,dbg_facility,"adopt_gop: gog=%p gop=%p",gog,gop);
gop->gog = gog;
gop->next = NULL;

View File

@ -36,7 +36,8 @@
/******* dbg_print *********/
#define DEBUG_BUFFER_SIZE 4096
extern void dbg_print(const gint* which, gint how, FILE* where, const gchar* fmt, ... );
extern void dbg_print(const gint* which, gint how, FILE* where,
const gchar* fmt, ... ) G_GNUC_PRINTF(4, 5);
/******* single copy strings *********/
@ -49,7 +50,8 @@ typedef struct _scs_collection SCS_collection;
extern gchar* scs_subscribe(SCS_collection* collection, const gchar* s);
extern void scs_unsubscribe(SCS_collection* collection, gchar* s);
extern gchar* scs_subscribe_printf(SCS_collection* collection, gchar* fmt, ...);
extern gchar* scs_subscribe_printf(SCS_collection* collection, gchar* fmt, ...)
G_GNUC_PRINTF(2, 3);
/******* AVPs & Co. *********/

View File

@ -339,7 +339,7 @@ static void dissect_mac_mgmt_msg_arq_feedback_decoder(tvbuff_t *tvb, packet_info
arq_fb_item = proto_tree_add_protocol_format(arq_feedback_tree, proto_mac_mgmt_msg_arq_decoder, tvb, offset, tvb_len, "ARQ_Feedback_IE");
proto_item_append_text(arq_fb_item, ", CID: %u, %s ARQ feedback IE, %s, BSN: %u",
arq_cid, arq_last ? "Last" : "More", val_to_str(arq_ack_type, vals_arq_ack_type, ""), arq_bsn);
arq_cid, arq_last ? "Last" : "More", val_to_str_const(arq_ack_type, vals_arq_ack_type, ""), arq_bsn);
if (arq_ack_type != ARQ_CUMULATIVE_ACK_ENTRY) {
proto_item_append_text(arq_fb_item, ", %u ACK Map(s)", arq_num_ack_maps);
}
@ -442,3 +442,15 @@ proto_reg_handoff_mac_mgmt_msg_arq(void)
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_ARQ_RESET, arq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

View File

@ -112,7 +112,7 @@ static gint16 *attr_uint16;
static guint wimaxasncp_bits(guint bits, char *n);
static gint wimaxasncp_decode_type(const gchar *name);
static void wimaxasncp_dict_debug(const gchar *fmt, ...);
static void wimaxasncp_dict_debug(const gchar *fmt, ...) G_GNUC_PRINTF(1, 2);
static void append_to_buffer(const gchar *txt, int len);
static FILE *wimaxasncp_dict_open(const gchar*, const gchar*);

View File

@ -59,7 +59,8 @@ wchar_t * utf_8to16(const char *utf8str);
* @param fmt A standard g_printf() format string
*/
WS_DLL_PUBLIC
void utf_8to16_snprintf(TCHAR *utf16buf, gint utf16buf_len, const gchar* fmt, ...);
void utf_8to16_snprintf(TCHAR *utf16buf, gint utf16buf_len, const gchar* fmt,
...) G_GNUC_PRINTF(3, 4);
/** Given a UTF-16 string, convert it to UTF-8. This is meant to be used
* to convert between GTK+ 2.x (UTF-8) to Windows (UTF-16).