Fix a core dump causing the buildbot test menagerie to fail. It was caused by incorre...
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 25 Dec 2004 14:46:40 +0000 (14:46 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 25 Dec 2004 14:46:40 +0000 (14:46 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12833 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-pgsql.c

index 7a9dfbacea788b7c60c9130671eb65ff3114422d..3dc31d7518c95f442054d3e25ab0ce84eef1a8ed 100644 (file)
@@ -524,7 +524,8 @@ static void dissect_pgsql_fe_msg(guchar type, guint32 n, guint32 length,
             l = tvb_get_ntohl(tvb, n);
             proto_tree_add_int(shrub, hf_val_length, tvb, n, 4, l);
             n += 4;
-            if (l > 0)
+            /* XXX - if we don't limit l here, the function will assert on very large values */
+            if (l > 0 && l < 1000000)
                 proto_tree_add_item(shrub, hf_val_data, tvb, n, l, FALSE);
             n += l;
         }
@@ -778,7 +779,8 @@ static void dissect_pgsql_be_msg(guchar type, guint32 n, guint32 length,
             l = tvb_get_ntohl(tvb, n);
             proto_tree_add_int(shrub, hf_val_length, tvb, n, 4, l);
             n += 4;
-            if (l > 0)
+            /* XXX - if we don't limit l here, the function will assert on very large values */
+            if (l > 0 && l < 1000000)
                 proto_tree_add_item(shrub, hf_val_data, tvb, n, l, FALSE);
             n += l;
         }