aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smb-common.c
AgeCommit message (Collapse)AuthorFilesLines
2017-01-31format_text_wmem -> format_textMichael Mann1-1/+1
All cases of the "original" format_text have been handled to add the proper wmem allocator scope. Remove the "original" format_text and replace it with one that has a wmem allocator as a parameter. Change-Id: I278b93bcb4a17ff396413b75cd332f5fc2666719 Reviewed-on: https://code.wireshark.org/review/19884 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-31Add format_text_wmem.Michael Mann1-1/+1
This allows for a wmem_allocator for users of format_text who want it (dissectors for wmem_packet_scope()). This lessens the role of current format_text functionality in hopes that it will eventually be replaced. Change-Id: I970557a65e32aa79634a3fcc654ab641b871178e Reviewed-on: https://code.wireshark.org/review/19855 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-19dns: change get_dns_name to return consumed bytes + actual name len.Dario Lombardo1-2/+4
Because of the DNS name encoding, the consumed bytes in the tvb and the length of the string of the dns name can be different. We need to handle them separately for the purpose they are. Moreover the name string can contain null bytes, then we can't rely on strlen() but we need the actual length. Subsequent calls to proto_tree_add_string() will require to pass the string to format_text() in order have non-printable characters printed. Bug: 13289 Change-Id: I6d0b295867ece265f8995f82da2c629992aeb703 Reviewed-on: https://code.wireshark.org/review/19539 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-04Add editor modelines; Reformat as appropriate.Bill Meier1-16/+29
Change-Id: I8e9c58b75eea85877d22024201e5d8d0e9a3dbfd Reviewed-on: https://code.wireshark.org/review/4459 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-1/+1
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-01-31Revert "In get_unicode_or_ascii_string(), check if the length is odd/even, ↵Stefan Metzmacher1-1/+1
not the offset. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5778 - Volume label field ... is not displayed correctly ..." This is wrong it breaks all sort of things. The "Volume label field" is a special case, which can be fixed by using nopad=TRUE. Change-Id: I3cd3f30ff0076d5e31a735391b175fd68e5fa142 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/26 Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2014-01-14Have ip6_to_str() and tvb_ip6_to_str() return const pointers, as theGuy Harris1-2/+2
ip_to_str equivalents do. Don't cast away constness, and don't make it necessary to do so. svn path=/trunk/; revision=54767
2013-09-22More emem -> wmem conversion:Pascal Quantin1-1/+1
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz() - tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc() - tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz() - tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str() - update docs accordingly svn path=/trunk/; revision=52180
2013-09-13Dario Lombardo <lomato@gmail.com> viaJörg Mayer1-4/+4
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9147 Migration from emem to wmem for trivial cases (ep_alloc only). svn path=/trunk/; revision=52002
2013-03-18From beroset:Anders Broman1-3/+3
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48400
2012-09-26In get_unicode_or_ascii_string(), check if the length is odd/even, not the ↵Chris Maynard1-1/+1
offset. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5778 - Volume label field ... is not displayed correctly ... #BACKPORT(1.8, 1.6) svn path=/trunk/; revision=45150
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-04-18Removed some unneeded assignments.Stig Bjørlykke1-1/+1
Found by clang. svn path=/trunk/; revision=36698
2011-02-23Split get_dns_name() into get_dns_name() and expand_dns_name().Gerald Combs1-69/+10
In dissect_ms_compressed_string() dissect_mscldap_string() simply call expand_dns_name() instead of using duplicate (and insecure) code. This *might* break CLDAP and SMB dissection. If that's the case we should probably revert get_dns_name() and simplify expand_dns_name(). Fixes infinite recursion errors found by joernchen of Phenoelit. svn path=/trunk/; revision=36029
2011-01-16There's no need to pass the result of tvb_get_ptr() as the 'value' inJeff Morriss1-2/+1
proto_tree_add_*(): just use proto_tree_add_item(). Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or tvb_get_const_stringz(). Use tvb_memeql() & tvb_memcmp(). svn path=/trunk/; revision=35558
2010-12-21Fix indentation: change from a mixture of 2 and 4 spaces to tabs (whichStephen Fisher1-168/+187
is what packet-smb.c uses) and add extra line breaks. Both changes are for improved readbility of the frequent complex and cryptic loops. svn path=/trunk/; revision=35238
2010-04-06#include <string.h> not needed.Bill Meier1-2/+0
svn path=/trunk/; revision=32411
2008-03-01Rewrote to use g_strlcpy and g_strlcat.Stig Bjørlykke1-1/+2
svn path=/trunk/; revision=24525
2008-02-02Rewrote some prohibited APIs in epan/dissectors/ (sprintf, strcpy, strcat).Stig Bjørlykke1-1/+1
If we get some truncated strings we probably overwrote some buffers... svn path=/trunk/; revision=24249
2007-03-30Fix more warningsStephen Fisher1-1/+1
svn path=/trunk/; revision=21286
2006-11-26Problem: Bill Meier1-7/+6
"off by 1" bug in packet-smb-common.c: dissect_ms_compressed_string_internal() was causing a 1 character buffer overflow thus causing the canary to sing ! Fixes bug #1241 svn path=/trunk/; revision=19983
2006-11-24From Stefan Metzmacher:Jaap Keuter1-0/+78
I created two patches: 1.) move the handling of the compressed strings in CLDAP 'netlogon' replies into a generic place. 2.) implement dissection of SMB_NETLOGON cmd's 0x17 and 0x19 svn path=/trunk/; revision=19970
2006-05-21change a whole bunch of ethereal into wiresharkRonnie Sahlberg1-3/+3
svn path=/trunk/; revision=18196
2005-08-19remove g_malloc() from packet-smb-commonRonnie Sahlberg1-3/+1
svn path=/trunk/; revision=15420
2005-08-17replace a whole bunch of silly rotating stating buffers with ep_alloc() callsRonnie Sahlberg1-18/+5
this should fix a whole number of display bugs when there are too many such pdus in a single frame for the silly buffers to handle before they wrap. svn path=/trunk/; revision=15384
2005-08-10tvb_get_stringz() to tvb_get_ephemeral_stringz() conversionRonnie Sahlberg1-3/+1
svn path=/trunk/; revision=15276
2004-12-01Get rid of a long-obsolete comment.Guy Harris1-6/+0
svn path=/trunk/; revision=12630
2004-08-02"dissect_smb_unknown()" isn't some generic routine, it's used only toGuy Harris1-11/+0
dissect unknown netlogon commands; move it to "packet-smb-logon.c". svn path=/trunk/; revision=11589
2004-08-02Don't drag in a huge pile of headers in "packet-smb-common.h"; rely onGuy Harris1-0/+9
the files including it to include what they need. svn path=/trunk/; revision=11588
2004-08-02Move the NTLMv2 blob stuff back into packet-ntlmssp.c - it's moreGuy Harris1-198/+0
NTLMSSP-related than SMB-related, and documents about NTLMSSP talk about it, so it's a little more convenient to keep all that stuff together - and export it through a packet-ntlmssp.h header. svn path=/trunk/; revision=11585
2004-07-18Move dissectors to epan/dissectors directory.Gilbert Ramirez1-0/+490
Also move ncp222.py, x11-fields, process-x11-fields.pl, make-reg-dotc, and make-reg-dotc.py. Adjust #include lines in files that include packet-*.h files. svn path=/trunk/; revision=11410