diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-10-27 23:55:13 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-10-28 13:58:09 +0000 |
commit | 4c69f10aa42070616b92886f104f5a16eb88f00c (patch) | |
tree | f453bd87b7d5f4eadd57375b2572a49e05357c35 /ui/qt/uat_dialog.cpp | |
parent | d1f0e7273401e1470b8ed919961e6989eab1f986 (diff) | |
download | wireshark-4c69f10aa42070616b92886f104f5a16eb88f00c.tar.gz |
Qt: initialize all UAT fields when creating a new line
Otherwise it can trigger a crash when calling the callback while some fields have a NULL pointer (SSL post_update_cb for example)
Change-Id: I25ac97d8e0bbf47e737f74029715358cb29cfb3d
Reviewed-on: https://code.wireshark.org/review/11334
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'ui/qt/uat_dialog.cpp')
-rw-r--r-- | ui/qt/uat_dialog.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/qt/uat_dialog.cpp b/ui/qt/uat_dialog.cpp index 25c3409bd2..141e20bfac 100644 --- a/ui/qt/uat_dialog.cpp +++ b/ui/qt/uat_dialog.cpp @@ -484,12 +484,19 @@ void UatDialog::addRecord(bool copy_from_current) } else { for (guint col = 0; col < uat_->ncols; col++) { uat_field_t *field = &uat_->fields[col]; - if (field->mode == PT_TXTMOD_ENUM) { + switch (field->mode) { + case PT_TXTMOD_ENUM: guint length; const char *str; field->cb.tostr(rec, &str, &length, field->cbdata.tostr, field->fld_data); field->cb.set(rec, str, length, field->cbdata.set, field->fld_data); g_free((char*)str); + break; + case PT_TXTMOD_NONE: + break; + default: + field->cb.set(rec, "", 0, field->cbdata.set, field->fld_data); + break; } } } |