diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-12-25 14:46:40 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-12-25 14:46:40 +0000 |
commit | 872a86081411f8911e58b8e32057c65172ddf6e5 (patch) | |
tree | 3a3b8fe55a12de5133d8e47ebe55ee7bdf408a08 /epan/dissectors/packet-pgsql.c | |
parent | 78ff68d4b58f3887139b2d1fd6fec5c8d2658aa7 (diff) |
Fix a core dump causing the buildbot test menagerie to fail. It was caused by incorrectly trying to proto_tree_add_item() with a very huge length. However, someone with more SQL knowledge than me should have a qualified look at that place and do a better fix.
svn path=/trunk/; revision=12833
Diffstat (limited to 'epan/dissectors/packet-pgsql.c')
-rw-r--r-- | epan/dissectors/packet-pgsql.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-pgsql.c b/epan/dissectors/packet-pgsql.c index 7a9dfbacea..3dc31d7518 100644 --- a/epan/dissectors/packet-pgsql.c +++ b/epan/dissectors/packet-pgsql.c @@ -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; } |