Commit Graph

21 Commits

Author SHA1 Message Date
Jörg Mayer 1900bf87fc done:
packet-ntp.c: Rather confused and incorrect use of g_snprintf return value
packet-pim.c: whitespace change
packet-icmpv6.c: g_snprintf takes trailing \0 into account, fix off by 1 error
packet-clnp.c: Fix incorrect use of g_snprintf return value
packet-isakmp.c: g_snprintf takes trailing \0 into account
packet-tr.c: Fix incorrect use of g_snprintf return value
packet-radius.c: Fix incorrect use of g_snprintf return value
packet-radius.h: constify a string variable
packet-ldap.c: The return value isn't needed, so don't use it incorrectly
packet-tcp.c: Fix incorrect use of g_snprintf return value
packet-windows-common.c: Remove unneeded DISSECTOR_ASSERT
packet-smb-sidsnooping.c: g_snprintf takes trailing \0 into account
packet-pvfs2.c: g_snprintf takes trailing \0 into account
packet-ptp.c: Remove #include snprintf
packet-ppp.c: Fix incorrect use of g_snprintf return value
packet-ospf.c: Fix incorrect use of g_snprintf return value
packet-mip6.c: snprintf -> g_snprintf
packet-bootp.c: Remove a commented out bad use of g_snprintf
packet-ber.c: snprintf -> g_snprintf, g_snprintf takes trailing \0 into account

2do:

     52 packet-ieee80211.c: 2DO
      2 packet-nfs.c: 2DO - too many side effects
     33 packet-bgp.c: 2DO
     18 packet-dns.c: 2DO
     14 packet-dcm.c: 2DO
     13 packet-x11.c: 2DO
     11 packet-kerberos.c: 2DO
     10 packet-diameter.c: 2DO
      9 packet-snmp.c: 2DO
      9 packet-pgm.c: 2DO
      7 packet-nbns.c: 2DO
      6 packet-fcswils.c: 2DO
      5 packet-wccp.c: 2DO
      5 packet-cops.c: 2DO
      4 packet-wtp.c: 2DO


svn path=/trunk/; revision=17038
2006-01-16 07:59:44 +00:00
Jörg Mayer 122671b36c Jaap Keuter:
I'm not too fond of using pointer arithmetic in such cases. How about
this:


svn path=/trunk/; revision=17031
2006-01-14 23:09:44 +00:00
Jörg Mayer 0bfcf705cd We may not work with the length returned by g_snprintf, as this is
the number of bytes that would have been used if the buffer was long
enough.
Fixes http://bugs.ethereal.com/bugzilla/show_bug.cgi?id=686

svn path=/trunk/; revision=17030
2006-01-14 11:29:24 +00:00
Ronnie Sahlberg 4e518c616d some ACEs are not used for authorization and thus do NOT contain an access mask and a SID.
make the dissection of the ACL check the type for each individual ACE and only dissect  as access mask and sid  those ACEs we know how to handle.


this prevents ethereal from dumping on w32 if we encounter any of these "special" ACE entries,   such as the ones used for storing location data for offline files.




svn path=/trunk/; revision=16881
2005-12-22 08:51:50 +00:00
Guy Harris 2a8e47b11a Don't ensure all the bytes of a security descriptor exist before calling
"dissect_nt_sec_desc()".  Add a Boolean argument to
"dissect_nt_sec_desc()" to indicate whether a length was passed to it
(so we don't treat -1 as a special value; we want to stop treating -1 as
a special length value, and, in fact, want to stop treating *any*
negative length values specially, so that we don't have to worry about
passing arbitrary 32-bit values from packets as lengths), and have
"dissect_nt_sec_desc()" initially create the protocol tree item for the
security descriptor with a length of "go to the end of the tvbuff", and
set the length once we're done dissecting it - and, if the length was
specified, check at *that* point, *after* we've dissected the security
descriptor, whether we have the entire security descriptor in the
tvbuff.

That means that we don't have to worry about overflows after
"dissect_nt_sec_desc()" returns - if the length was so large that we
would have gotten an overflow, we'd have thrown an exception in the
"tvb_ensure_bytes_exist()" call at the end of "dissect_nt_sec_desc()".

Do sanity checks on offsets within the security descriptor, so we know
the item referred to by the offset is after the fixed-length portion of
the descriptor.

svn path=/trunk/; revision=16113
2005-10-04 10:23:40 +00:00
Guy Harris ab2dca9114 Move some headers for stuff defined by a dissector into epan/dissectors
- and rename smb.h to packet-smb.h, as it's packet-smb.c's header file.

svn path=/trunk/; revision=15845
2005-09-17 00:31:15 +00:00
Guy Harris b7b80d94be Move a pile of protocol-related headers from the top-level source
directory to the epan directory.  Some of them should perhaps ultimately
be moved to epan/dissectors, if they pertain only to stuff exported by a
particular dissector.

Fix Gerald's e-mail address in files we're moving.

svn path=/trunk/; revision=15844
2005-09-17 00:02:31 +00:00
Ronnie Sahlberg 259de71199 change one g_string_sprintf() into g_snprintf() and move one array of characters from the stack into emem allocated memory
svn path=/trunk/; revision=15617
2005-08-30 08:23:50 +00:00
Jörg Mayer 2b2506f0f6 More char -> const char warning fixes
svn path=/trunk/; revision=15222
2005-08-05 13:10:58 +00:00
Guy Harris 89e823ea4f Yet more constification.
svn path=/trunk/; revision=14788
2005-06-26 21:11:22 +00:00
Ulf Lamping bb4e980df1 bugfix: use g_snprintf instead of sprintf to prevent a buffer overflow
svn path=/trunk/; revision=14515
2005-06-01 19:17:59 +00:00
Ronnie Sahlberg a43da7a4ff add dissection of three new flags in the security descriptor
svn path=/trunk/; revision=13210
2005-01-30 23:15:10 +00:00
Guy Harris 7e7d12b446 Update a URL.
svn path=/trunk/; revision=12864
2004-12-30 02:21:33 +00:00
Ulf Lamping e8459f4ea1 Again, some warnings removed.
svn path=/trunk/; revision=12831
2004-12-25 10:30:58 +00:00
Guy Harris e501ee7f01 Check for all bogus ACE lengths, i.e. all lengths < 4.
Clean up indentation.

Add a comment asking whether the revision in an ACL is *really* 2 bytes
and the ACE count is *really* 4 bytes.

svn path=/trunk/; revision=12816
2004-12-22 10:44:20 +00:00
Gerald Combs d528c62de1 From Brian Caswell:
The ACL parser will attempt to decode as many ACE structures as are
specified in the ACL structure.  If the number of ACE structures is
sufficiently large with one of the ACE structures specifying a size of
0, then the ACL parser will parse that ACE structure repeatedly,
eventually causing a denial of service to Ethereal.

I've attached a diff against HEAD that corrects the problem.  The diff
also corrects a few decoding errors in the NT ACL & ACE structures.  A
pcap is attached that reproduces the problem.

svn path=/trunk/; revision=12706
2004-12-09 22:17:50 +00:00
Guy Harris 329415a52a MSVC++ doesn't understand that "64_bit_integer % 10000000" fits in an
"int", so we throw in a cast to squelch a warning.

svn path=/trunk/; revision=11774
2004-08-19 09:00:20 +00:00
Guy Harris 5fa4e1f01f Use "G_GINT64_CONSTANT()" for 64-bit integral constants, rather than
hardwiring "LL" as the suffix - it's not "LL" in MSVC++.

svn path=/trunk/; revision=11773
2004-08-19 07:55:30 +00:00
Guy Harris bd2930f29e Don't do the FILETIME->nstime_t conversion in floating point, as it
produces some floating-point noise in the nanoseconds field; we've
required 64-bit integer support for a while, so use that.

svn path=/trunk/; revision=11754
2004-08-16 22:30:04 +00:00
Ulf Lamping cf22aa8bbc cast define of TIME_T_MIN and TIME_T_MAX to (time_t), as MSVC seems to have problems with this definition and throws a warning "convert negative constant to unsigned integer"
svn path=/trunk/; revision=11753
2004-08-16 17:18:04 +00:00
Guy Harris 13bb12c4f1 Move a bunch of stuff that's more Windows-related than SMB-related to
"packet-windows-common.[ch]".

svn path=/trunk/; revision=11592
2004-08-03 02:28:49 +00:00