Commit Graph

170 Commits

Author SHA1 Message Date
Anders Broman 42b44648c8 Get rid of Warnings.
svn path=/trunk/; revision=39954
2011-11-20 08:59:19 +00:00
Tomas Kukosa bc5301e114 Fix handling of empty OpenType at the end of PDU
svn path=/trunk/; revision=39880
2011-11-16 08:55:02 +00:00
Guy Harris bdc92e9a5d Add missing semicolon.
svn path=/trunk/; revision=39555
2011-10-25 06:08:16 +00:00
Anders Broman 585ee5026d From Neil Piercy:
The binary display and decimal values are corrupt in the case where they are
"stitched" together from words and octets: the complete words are extracted
ready for LSB padding, but when the final octet/word is added (also so
extracted), the data already present is shifted by a whole number of octets
(not allowing for the padding), and the value is then used by the binary and
decimal display functions as if it were MSB padded. This results in both a
corrupt bit pattern and wrong padding of the bit pattern in the display.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6473

svn path=/trunk/; revision=39553
2011-10-25 05:46:31 +00:00
Bill Meier 54b72021bb Fix encoding arg for various fcn calls:
- proto_tree_add_bits_item
 - proto_tree_add_bits_ret_val
 - proto_tree_add_bitmask
 - tvb_get_bits
 - tvb_get_bits16
 - tvb_get_bits24
 - tvb_get_bits32
 - tvb_get_bits64


svn path=/trunk/; revision=39539
2011-10-24 19:57:53 +00:00
Bill Meier d7a1840204 Replace use of tvb_get_ephemeral_faked_unicode() by use of tvb_get_ephemeral_unicode_string();
Fix encoding arg as needed.

svn path=/trunk/; revision=39530
2011-10-23 22:58:45 +00:00
Anders Broman 44f914a0f1 From Pascal Quantin:
I identified a new regression. When selecting a bit string, the highlighted bytes in the packet view are not the correct ones.

svn path=/trunk/; revision=39220
2011-10-02 15:12:47 +00:00
Anders Broman 5f76488f0a Move tvb_new_octet_aligned() to tvbuff.c and use it.
svn path=/trunk/; revision=39150
2011-09-26 15:11:14 +00:00
Anders Broman f7b214378b From Pascal Quantin:
Incorrect decoding of BIT STRING type

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6347

svn path=/trunk/; revision=39017
2011-09-15 20:02:19 +00:00
Tomas Kukosa 733452afd7 Support for Extension Addition Group in PER encoding
Fix for bug 6196 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6199

svn path=/trunk/; revision=38421
2011-08-09 08:00:06 +00:00
Bill Meier 3f7e7672c9 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.
svn path=/trunk/; revision=38095
2011-07-18 19:11:32 +00:00
Anders Broman 3d17e592d5 From Pascal Quantin:
Do not trigger an assert when reaching an unknown extension in CHOICE and SEQUENCE types.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6087

svn path=/trunk/; revision=37886
2011-07-04 06:22:15 +00:00
Anders Broman cab0dc1340 Don't treat the aligned and unaligned bit strings differently
always padd LSBs.
 Hopfully this does not break anything else...

svn path=/trunk/; revision=35680
2011-01-27 15:48:02 +00:00
Anders Broman 66053b7b3a From Johannes Lange:
Function dissect_per_bit_string_display might read more bytes than available (PER dissector).
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5394

svn path=/trunk/; revision=35023
2010-11-24 16:35:23 +00:00
Anders Broman 4d4283ef98 From Johannes Lange:
Bug 5393 - Wrong length calculation in new_octet_aligned_subset_bits() (PER dissector) .
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5393

svn path=/trunk/; revision=35021
2010-11-24 16:21:04 +00:00
Stig Bjørlykke 2b37214674 From Pascal Quantin via bug 5301:
Make the PER constaints check like in the BER dissector.

svn path=/trunk/; revision=34536
2010-10-17 14:07:05 +00:00
Stig Bjørlykke 38ba5119cd From Pascal Quantin via bug 5301:
Add expert info when ASN.1 PER constrained integer does not match range.

svn path=/trunk/; revision=34531
2010-10-17 11:59:10 +00:00
Tomas Kukosa a974e115ce Fix start offset and length handling in SEQUNCE OF (caused Gtk crash for sequences at the end of frame)
svn path=/trunk/; revision=34058
2010-09-03 10:31:56 +00:00
Stig Bjørlykke 026f4dfa7b Fixed guint64 printf modifier.
svn path=/trunk/; revision=33799
2010-08-14 17:22:22 +00:00
Anders Broman 856f205c27 Fix up decoding of bitfields in the aligned variant.
svn path=/trunk/; revision=33798
2010-08-14 16:42:41 +00:00
Anders Broman 91e949512d From Neil Piercy:
Fix  misleading PER Bit string display.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4789
(I Added bits display)

svn path=/trunk/; revision=32948
2010-05-25 19:29:23 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Bill Meier 9b568ea691 Fix gcc -Wshadow warnings
svn path=/trunk/; revision=31561
2010-01-19 00:37:39 +00:00
Gerasimos Dimitriadis 2e138172a2 Constrained SEQ OF in PER encoding associated with wrong length;
also take into account cases of length 0.

svn path=/trunk/; revision=31219
2009-12-09 21:18:04 +00:00
Guy Harris 3bb1cd12a4 No non-ASCII characters, please.
svn path=/trunk/; revision=31049
2009-11-22 21:54:50 +00:00
Anders Broman 98c852386d Handle lenght restriction extension of restricted strings.
Fixes 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4251

svn path=/trunk/; revision=31047
2009-11-22 17:00:45 +00:00
Anders Broman 9aa6257dde Handle extended PER bitstrings.
svn path=/trunk/; revision=31034
2009-11-20 21:40:28 +00:00
Stig Bjørlykke c60a5b284e Added offset fix from bug 4202, error introduced in r30770.
svn path=/trunk/; revision=30815
2009-11-04 11:41:05 +00:00
Guy Harris c9b5bc30d0 assert() doesn't throw an exception, it just immediately crashes the
app, and DISSECTOR_ASSERT() throws an exception, but claims the problem
is a dissector bug, not a malformed packet.  Presumably the error in
question is the result of a malformed packet, so throw
ReportedBoundsError to indicate that (it's not really the *right*
exception, but the right exception doesn't exist).

svn path=/trunk/; revision=30776
2009-10-31 08:31:21 +00:00
Anders Broman d3b7b182c1 - In new_octet_aligned_subset_bits() the length check must be on octet not bits.
- try to make the code a bit more readable.

svn path=/trunk/; revision=30770
2009-10-30 16:09:32 +00:00
Anders Broman 88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +00:00
Jeff Morriss 46fc4eea81 new_octet_aligned_subset_bits(): call tvb_ensure_bytes_exist() before
attmepting to malloc memory to ensure we've been asked to decode a reasonable
number of bits (and thus are asking for a reasonable number of bytes from
malloc()).

That should fix the fuzz failure in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4138

Add a comment to new_octet_aligned_subset() asking why we're resetting the
length to tvb_length()--that means we'll never throw an exception.

svn path=/trunk/; revision=30611
2009-10-18 23:19:44 +00:00
Stig Bjørlykke fd2662b27f Added a check for num_opts to avoid a theoretical undefined behavior.
svn path=/trunk/; revision=30537
2009-10-12 14:43:09 +00:00
Anders Broman bc9a809b65 From Didier Gautheron:
ep memory can't be used for tvbs defined as data_source.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4054

svn path=/trunk/; revision=30376
2009-10-06 19:15:58 +00:00
Anders Broman af3ad92c81 From Sean Yunjnz:
Problem in packet-per.c for ASN.1 PER Encoding.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3733

svn path=/trunk/; revision=29124
2009-07-16 21:09:18 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Anders Broman ea4f4f08af Froim Vincent Helfre:
Fix issues with unaligned PER.

svn path=/trunk/; revision=28374
2009-05-15 18:39:33 +00:00
Anders Broman c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Anders Broman 6f74922803 From Vincent Helfre and Me:
- Dissect GSM messages.
- Add functions to libwireshark needed by plugins.

svn path=/trunk/; revision=28068
2009-04-16 19:01:31 +00:00
Tomas Kukosa b555f92211 do not report encoding error for sequence extension with length 0
highlight one byte also for NULL type

svn path=/trunk/; revision=28043
2009-04-14 07:38:02 +00:00
Anders Broman b1b5873c48 Handle PER constrained integer > 32 bits, show more internal PER fields.
svn path=/trunk/; revision=28026
2009-04-10 09:24:10 +00:00
Anders Broman daf059d5ed Remove #if 0
svn path=/trunk/; revision=27931
2009-04-02 17:04:04 +00:00
Anders Broman 19de9df296 From Vincent Helfre:
Fix unaligned bitfields.

svn path=/trunk/; revision=27907
2009-03-31 05:44:48 +00:00
Anders Broman 98d0847eda From Vincent Helfre:
Fix unaligned bitfields.
From me activate the SEQUENCE OF patch.

svn path=/trunk/; revision=27853
2009-03-26 18:01:26 +00:00
Anders Broman 99bbe55222 Make it possible to check for extension marker in SEQUENCE OF and SET OF.
Fore some reason  the trace in bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3360 does not decode properly
if dissecting the exension marker so leave that code #if 0:ed out for now.

svn path=/trunk/; revision=27848
2009-03-25 22:04:23 +00:00
Stig Bjørlykke 1c9cbffcdf From Neil Piercy (bug 3299):
Added support for length greater than 127 (less than 16K).

svn path=/trunk/; revision=27603
2009-03-03 22:46:47 +00:00
Bill Meier c0e92cbc04 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27065
2008-12-20 00:09:02 +00:00
Stig Bjørlykke 76ba68775b Do not call a variable value_string as we have a struct with this name.
svn path=/trunk/; revision=26658
2008-10-31 18:42:53 +00:00
Stig Bjørlykke e6a22e689e Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26648
2008-10-31 15:34:00 +00:00
Tomas Kukosa 1644e4138a Get rid of few warnings (unused generated code, signed/unsigned mismatch)
svn path=/trunk/; revision=25839
2008-07-26 15:28:04 +00:00