aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2010-01-25 10:22:00 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2010-01-25 10:22:00 +0000
commite967b6185bd635a2feb98b3d9b2d5619f62b225e (patch)
tree6357cc06e59a7a9cbcc7bd5d2879ef56ae6a0ab0
parent4546ca0f53b9d7e7ce8b84f5b19f84fa994305c5 (diff)
Ensure we don't write outside the pref_str in put_string_list().
This bug was introduced in revision 31487, when putting each column.format entry on separate lines. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31653 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--epan/prefs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 1b9788a8a9..d4915950e5 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -934,7 +934,7 @@ put_string_list(GList *sl)
if ((fmt_len + cur_len) < (MAX_FMT_PREF_LEN - 1)) {
if (item_count % 2) {
/* Wrap the line. */
- cur_len--;
+ if (cur_len > 0) cur_len--;
cur_pos = 0;
pref_str[cur_len] = '\n'; cur_len++;
pref_str[cur_len] = '\t'; cur_len++;