diff options
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/iseries.c | 4 | ||||
-rw-r--r-- | wiretap/k12.c | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/wiretap/iseries.c b/wiretap/iseries.c index 4c31cf1724..f9ba4b303a 100644 --- a/wiretap/iseries.c +++ b/wiretap/iseries.c @@ -123,6 +123,8 @@ #include <ctype.h> #include <errno.h> +#include <wsutil/str_util.h> + #define ISERIES_HDR_MAGIC_STR " COMMUNICATIONS TRACE" #define ISERIES_HDR_MAGIC_LEN 21 #define ISERIES_PKT_MAGIC_STR "ETHV2" @@ -275,7 +277,7 @@ iseries_check_file_type (wtap * wth, int *err, int format) { iseries_UNICODE_to_ASCII ((guint8 *)buf, ISERIES_LINE_LENGTH); } - g_ascii_strup(buf,ISERIES_LINE_LENGTH); + ascii_strup_inplace(buf); num_items_scanned = sscanf (buf, " OBJECT PROTOCOL . . . . . . : %8s", protocol); diff --git a/wiretap/k12.c b/wiretap/k12.c index fcb92a0373..4088b9a896 100644 --- a/wiretap/k12.c +++ b/wiretap/k12.c @@ -32,12 +32,15 @@ #include <stdlib.h> #include <string.h> #include <errno.h> + #include "wtap-int.h" #include "wtap.h" #include "file_wrappers.h" #include "buffer.h" #include "k12.h" +#include <wsutil/str_util.h> + /*#define DEBUG_K12*/ #ifdef DEBUG_K12 #include <stdio.h> @@ -681,10 +684,13 @@ int k12_open(wtap *wth, int *err, gchar **err_info _U_) { rec->input_type = K12_PORT_ATMPVC; } + /* XXX - this is assumed, in a number of places (not just in the + ascii_strdown_inplace() call below) to be null-terminated; + is that guaranteed (even with a corrupt file)? */ rec->input_name = g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len, name_len); rec->stack_file = g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len + name_len, stack_len); - g_ascii_strdown (rec->stack_file,stack_len); + ascii_strdown_inplace (rec->stack_file); g_hash_table_insert(file_data->src_by_id,GUINT_TO_POINTER(rec->input),rec); g_hash_table_insert(file_data->src_by_name,rec->stack_file,rec); |