diff options
author | Michael Mann <mmann78@netscape.net> | 2015-01-17 14:11:29 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-01-19 02:52:11 +0000 |
commit | e333e4c90f0aca41b0a56cef22fd80d0b0e73e14 (patch) | |
tree | 0d90a0e8561d6e4cf1361d56629e649af655d40d /epan/ftypes/ftype-bytes.c | |
parent | 59155d1d1c40a979d5f5040e4df35ee72dadbb9c (diff) |
Convert OID APIs to use wmem.
There are a few oid functions that are only called in oids_test.c. I'll presume the APIs are used in proprietary dissectors rather than just remove them.
Change-Id: I4595e00f93bf9ab8cf2493fe0432b91960f55a3f
Reviewed-on: https://code.wireshark.org/review/6592
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/ftypes/ftype-bytes.c')
-rw-r--r-- | epan/ftypes/ftype-bytes.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/ftypes/ftype-bytes.c b/epan/ftypes/ftype-bytes.c index fc42f0c9f0..0669071ed3 100644 --- a/epan/ftypes/ftype-bytes.c +++ b/epan/ftypes/ftype-bytes.c @@ -97,7 +97,7 @@ oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_) static void oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf) { - const char* oid_str = oid_encoded2string(fv->value.bytes->data,fv->value.bytes->len); + char* oid_str = oid_encoded2string(NULL, fv->value.bytes->data,fv->value.bytes->len); /* * XXX: * I'm assuming that oid_repr_len is going to be called before to set buf's size. @@ -105,7 +105,8 @@ oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf) * I guess that is why this callback is not passed a length. * -- lego */ - strncpy(buf,oid_str,OID_REPR_LEN(fv)); + g_strlcpy(buf,oid_str,OID_REPR_LEN(fv)); + wmem_free(NULL, oid_str); } static int @@ -117,7 +118,7 @@ rel_oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_) static void rel_oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf) { - const char* oid_str = rel_oid_encoded2string(fv->value.bytes->data,fv->value.bytes->len); + char* oid_str = rel_oid_encoded2string(NULL, fv->value.bytes->data,fv->value.bytes->len); /* * XXX: * I'm assuming that oid_repr_len is going to be called before to set buf's size. @@ -126,7 +127,8 @@ rel_oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *b * -- lego */ *buf++ = '.'; - strncpy(buf,oid_str,REL_OID_REPR_LEN(fv)); + g_strlcpy(buf,oid_str,REL_OID_REPR_LEN(fv)); + wmem_free(NULL, oid_str); } static void |