diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-10-27 21:56:58 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-10-27 21:56:58 +0000 |
commit | 8e2f00bf3d3f390f1fbd83d1320d64174fbc9221 (patch) | |
tree | bffa1640e995db8105fa8e84d8e33add1bbbe0c9 /epan/ftypes | |
parent | b0aa70b8075234f71b7a365347c93eece520e559 (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9323 :
Actually handle non-NULL-terminated FT_STRINGs properly.
svn path=/trunk/; revision=52905
Diffstat (limited to 'epan/ftypes')
-rw-r--r-- | epan/ftypes/ftype-string.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/ftypes/ftype-string.c b/epan/ftypes/ftype-string.c index ff84603519..dada9a7169 100644 --- a/epan/ftypes/ftype-string.c +++ b/epan/ftypes/ftype-string.c @@ -46,13 +46,15 @@ string_fvalue_free(fvalue_t *fv) static void string_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied) { - DISSECTOR_ASSERT(value != NULL); - DISSECTOR_ASSERT(!already_copied); + DISSECTOR_ASSERT(value != NULL); /* Free up the old value, if we have one */ string_fvalue_free(fv); - fv->value.string = (gchar *)g_strdup((const gchar *)value); + if (already_copied) + fv->value.string = (gchar *)value; /* must be g_ allocated */ + else + fv->value.string = (gchar *)g_strdup((const gchar *)value); } static int |