(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/uat_gui.c) |
| |
| 138 | | | static char* fld_tostr(void* rec, uat_field_t* f) { |
| 139 | | | guint len; |
| 140 | | | const char* ptr; |
| 141 | | | char* out; |
| 142 | | | |
| 143 | | | f->cb.tostr(rec,&ptr,&len,f->cbdata.tostr,f->fld_data); |
| 144 | | | |
| 145 | | | switch(f->mode) { |
| 146 | | | case PT_TXTMOD_STRING: |
| 147 | | | case PT_TXTMOD_ENUM: |
| 148 | | | out = ep_strndup(ptr,len); |
| 149 | | | break; |
| 150 | | | case PT_TXTMOD_HEXBYTES: { |
| 151 | | | GString* s = g_string_sized_new( len*2 + 1 ); |
| 152 | | | guint i; |
| 153 | | | |
| 154 | | | for (i=0; i<len;i++) g_string_append_printf(s,"%.2X",((guint8*)ptr)[i]); |
| 155 | | | |
| 156 | | | out = ep_strdup(s->str); |
| 157 | | | |
| 158 | | | g_string_free(s,TRUE); |
| 159 | | | break; |
| 160 | | | } |
| 161 | | | default: |
| 162 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 163 | | | out = NULL; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 164 | | | break; |
| 165 | | | } |
| 166 | | | |
| 167 | | | return out; |
| 168 | | | } |
| |