aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/erf.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-07-17 18:43:44 -0700
committerGuy Harris <guy@alum.mit.edu>2017-07-18 01:44:42 +0000
commit74a2ae4abac3be78d140d9671fa79977de449ed1 (patch)
tree96174e0f8588fb271584cf32f188e92858b47029 /wiretap/erf.c
parentd35bb66516b25a4adf3f0471a1c6256680e4491a (diff)
Don't byte-swap an 1-byte value.
Convert it to a 4-byte value and byte-swap *that*. Fixes CID 1415438. Change-Id: I5cf0b5905f5dd2086c5d8ed6b13b1921bdb69a84 Reviewed-on: https://code.wireshark.org/review/22689 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/erf.c')
-rw-r--r--wiretap/erf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/wiretap/erf.c b/wiretap/erf.c
index 77d5ee6323..34c0f34b47 100644
--- a/wiretap/erf.c
+++ b/wiretap/erf.c
@@ -1068,6 +1068,7 @@ static void erf_write_wtap_option_to_interface_tag(wtap_block_t block _U_,
struct erf_meta_section *section_ptr = (struct erf_meta_section*) user_data;
struct erf_meta_tag *tag_ptr = NULL;
+ guint32 fcslen;
tag_ptr = (struct erf_meta_tag*) g_malloc0(sizeof(struct erf_meta_tag));
@@ -1133,7 +1134,8 @@ static void erf_write_wtap_option_to_interface_tag(wtap_block_t block _U_,
tag_ptr->type = ERF_META_TAG_fcs_len;
tag_ptr->length = 4;
tag_ptr->value = (guint8*)g_malloc(tag_ptr->length);
- phtonl(tag_ptr->value, (guint32)optval->uint8val);
+ fcslen = (guint32)optval->uint8val;
+ phtonl(tag_ptr->value, fcslen);
break;
/* TODO: Don't know what to do with these yet */
case OPT_IDB_EUIADDR: