aboutsummaryrefslogtreecommitdiffstats
path: root/epan/uat.h
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2009-03-08 22:31:28 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2009-03-08 22:31:28 +0000
commitb4c2f2044ad336e47c789a57da55d2f46ce681ee (patch)
tree09341d52ca598e641a28f5190d59295199f86e04 /epan/uat.h
parentb663f6d2180e7635b4e8372779452f8aeb3bff48 (diff)
Don't use ep_strndup() to copy the uat protocol name, because the value
can be free'ed before we use it. Allocate the string like we do for other strings and copy/free the memory in the appropriate copy_cb/free_cb functions. This is only used in the DLT_USER table yet. svn path=/trunk/; revision=27663
Diffstat (limited to 'epan/uat.h')
-rw-r--r--epan/uat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/uat.h b/epan/uat.h
index 728e13f453..1ba3bfa5e0 100644
--- a/epan/uat.h
+++ b/epan/uat.h
@@ -452,7 +452,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
#define UAT_PROTO_DEF(basename, field_name, dissector_field, name_field, rec_t) \
static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, void* u1 _U_, void* u2 _U_) {\
if (len) { \
- ((rec_t*)rec)->name_field = ep_strndup(buf,len); g_strdown(((rec_t*)rec)->name_field ); g_strchug(((rec_t*)rec)->name_field); \
+ ((rec_t*)rec)->name_field = g_strndup(buf,len); g_strdown(((rec_t*)rec)->name_field ); g_strchug(((rec_t*)rec)->name_field); \
((rec_t*)rec)->dissector_field = find_dissector(((rec_t*)rec)->name_field); \
} else { \
((rec_t*)rec)->dissector_field = find_dissector("data"); \