From 2ffd47dfe59166d01a60b3f4a301030000bfa711 Mon Sep 17 00:00:00 2001
From: Anders Broman <anders.broman@ericsson.com>
Date: Fri, 21 Dec 2012 09:12:09 +0000
Subject: [PATCH 1/6] Copy over: Revision 46646 - Clean up white space.

Add a return where I presume it was intended to be - a 4-octet address
is completely handled in that if clause, so there's no reason to fall
through.

Fix a comment.
--------------------------------------------------------------------------------
Revision 46645 - Fix some valgrind warnings from the capture attached to
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8110

I can't reproduce the actual reported crash on trunk.

--------------------------------------------------------------------------------
Revision 45646 - (try to) fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7871

increment offset to point to the first byte after the options
(the code used to set an absolute position, if that was 0, we were stuck
 in an endless loop)
--------------------------------------------------------------------------------
Revision 45059 - replaced decode_boolean_bitfield calls with itemized filters

svn path=/trunk-1.8/; revision=46659

Conflicts:
	epan/dissectors/packet-clnp.c
	epan/osi-utils.c
---
 epan/dissectors/packet-clnp.c |    2 +-
 epan/osi-utils.c              |   32 +++++++++++++++++---------------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c
index 7e2d82d..1f5b819 100644
--- a/epan/dissectors/packet-clnp.c
+++ b/epan/dissectors/packet-clnp.c
@@ -430,7 +430,7 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   /* Length of CLNP datagram plus headers above it. */
   len = segment_length;
 
-  offset = cnf_hdr_len;
+  offset += opt_len;
 
   /* If clnp_reassemble is on, this is a segment, we have all the
    * data in the segment, and the checksum is valid, then just add the
diff --git a/epan/osi-utils.c b/epan/osi-utils.c
index eb7b00f..281d496 100644
--- a/epan/osi-utils.c
+++ b/epan/osi-utils.c
@@ -22,7 +22,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -188,21 +188,23 @@ print_area_buf(const guint8 *ad, int length, gchar *buf, int buf_len)
       g_snprintf(buf, buf_len, "%02x.%02x%02x", ad[0], ad[1], ad[2] );
       return;
     }
-    if ( 4 < length ) {
-      while ( tmp < length / 4 ) {      /* 16/4==4 > four Octets left to print */
-        cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
-        cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+    if ( length == 4 ) {
+      g_snprintf(buf, buf_len, "%02x%02x%02x%02x", ad[0], ad[1], ad[2], ad[3] );
+      return;
+    }
+    while ( tmp < length / 4 ) {      /* 16/4==4 > four Octets left to print */
+      cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+      cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+      cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+      cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x.", ad[tmp++] );
+    }
+    if ( 1 == tmp ) {                     /* Special case for Designated IS */
+      cur--;
+      g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "-%02x", ad[tmp] );
+    }
+    else {
+      for ( ; tmp < length; ) {  /* print the rest without dot or dash */
         cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
-        cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x.", ad[tmp++] );
-      }
-      if ( 1 == tmp ) {                     /* Special case for Designated IS */
-        cur--;
-        g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "-%02x", ad[tmp] );
-      }
-      else {
-        for ( ; tmp < length; ) {  /* print the rest without dot */
-          cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
-        }
       }
     }
   }
-- 
1.7.10.4

