aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dtd_parse.l
AgeCommit message (Collapse)AuthorFilesLines
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-7/+6
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-19Disable flex-generated [-Wsign-compare] warningsJoão Valverde1-0/+4
Change-Id: Iace0462e6bb50573f3e4603f7a19e4b7ee1f9733 Reviewed-on: https://code.wireshark.org/review/23541 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-12-02Include config.h at the very beginning of all Flex scanners.Guy Harris1-2/+5
That way, if we #define anything for large file support, that's done before we include any system header files that either depend on that definition or that define it themselves if it's not already defined. Change-Id: I9b07344151103be337899dead44d6960715d6813 Reviewed-on: https://code.wireshark.org/review/19035 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-03Make the Flex scanners and YACC parser in libraries reentrant.Guy Harris1-51/+100
master-branch libpcap now generates a reentrant Flex scanner and Bison/Berkeley YACC parser for capture filter expressions, so it requires versions of Flex and Bison/Berkeley YACC that support that. We might as well do the same. For libwiretap, it means we could actually have multiple K12 text or Ascend/Lucent text files open at the same time. For libwireshark, it might not be as useful, as we only read configuration files at startup (which should only happen once, in one thread) or on demand (in which case, if we ever support multiple threads running libwireshark, we'd need a mutex to ensure that only one file reads it), but it's still the right thing to do. We also require a version of Flex that can write out a header file, so we change the runlex script to generate the header file ourselves. This means we require a version of Flex new enough to support --header-file. Clean up some other stuff encountered in the process. Change-Id: Id23078c6acea549a52fc687779bb55d715b55c16 Reviewed-on: https://code.wireshark.org/review/14719 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-05Use noyywrap rather than defining our own yywrap functions.Guy Harris1-11/+5
Tweak lemonflex-tail.inc to fix an issue this reveals. It appears that, at least on the buildbots, the Visual Studio compiler no longer issues warnings for the code generated with %option noyywrap. Change-Id: Id64d56f1ae8a79d0336488a4a50518da1f511497 Reviewed-on: https://code.wireshark.org/review/12433 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-06Don't include io.h in Flex scanners - they're not interactive.Guy Harris1-1/+1
We don't have any Flex scanners that support an interactive command-line interface, so none of our scanners are, or need to be, interactive. Mark text2pcap's scanner as not interactive. That means none of our scanners should call isatty(), so they don't have any need to include <io.h> on Windows; remove that include from the Lucent/Ascent text capture scanner. Update a comment to reflect that what matters isn't whether we can read from a terminal or whether we actually do so, what matters is whether they read *interactively* from a terminal (if you want to run text2pcap reading from the standard input and type at it, be my guest). Change-Id: I59979d1fdb37e1913125a400963ff7a3fa6b9bbd Reviewed-on: https://code.wireshark.org/review/11587 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-06Make some variables size_t, as values of that width are assigned to it.Guy Harris1-3/+3
(I'd say "as values of that *type* are assigned to it", but the "len" field of a GString is of type "gsize", and, for some unknown reason, the GLib folks, rather than just using size_t, which is required by C89 to be available, invented their own "gsize" type, defined as "long", which happens to be narrower than "size_t" on LLP64 platforms such as 64-bit Windows. Sigh....) This squelches some compiler warnings. Change-Id: Ifca1300297b2e9b777fb2c426dda822ba157cfe5 Reviewed-on: https://code.wireshark.org/review/4014 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-19Removed SVN Id from epan dir.Dario Lombardo1-2/+0
Change-Id: I487a3451344796447f0d5621b993cc89c29e93b5 Reviewed-on: https://code.wireshark.org/review/2383 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2013-12-14More shorten-64-to-32 warnings.Gerald Combs1-2/+2
svn path=/trunk/; revision=54106
2013-03-16[-Wmissing-prototypes]Anders Broman1-2/+2
Use explicit casts. svn path=/trunk/; revision=48338
2013-02-10Add %option noinput to a bunch of Flex files, as we aren't using theGuy Harris1-0/+5
input() routine and thus don't need to have it generated - and as it produces warnings of a routine defined but not used, we don't want to have it generated. Squelch a casting-const-away warning. svn path=/trunk/; revision=47613
2013-02-08Constify the name member of a struct _proto_xmlpi_attr, to squelchGuy Harris1-1/+1
warnings. svn path=/trunk/; revision=47561
2012-11-26Fix several [-Wshadow] warnings;Bill Meier1-9/+9
svn path=/trunk/; revision=46194
2011-08-11Replace use of deprecated g_strdown() by g_ascii_strdown();Bill Meier1-34/+33
Found when compiling with -DG_DISABLE_DEPRECATED svn path=/trunk/; revision=38469
2009-04-08Disable warnings-as-errors for Flex-generated output. Add a couple of gsizeGerald Combs1-1/+1
casts. svn path=/trunk/; revision=28002
2008-08-05luis.ontanon@gmail.com => luis@ontanon.orgLuis Ontanon1-1/+1
svn path=/trunk/; revision=25937
2008-05-11g_string_sprintf --> g_string_printf and g_string_sprintfa --> ↵Bill Meier1-2/+2
g_string_append_printf svn path=/trunk/; revision=25276
2008-04-29All versions of GLib 2.x come with g_ascii_strcasecmp(), and we requireGuy Harris1-4/+0
GLib 2.x; we don't have to check for its presence and supply a replacement if it's missing. Get rid of an unremoved reference in epan/dtd_parse.l. svn path=/trunk/; revision=25197
2008-04-25 Bug 2493: Fix (Part 2): Bill Meier1-5/+18
To prevent Windows compiler errors when using flex 2.5.35. Fixes "missing unistd.h" and yywrap "mismatched parameter" warnings [Upcoming Part 3: ignore 'signed /unsigned mismatch' errors] svn path=/trunk/; revision=25173
2007-11-27strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delendaGuy Harris1-2/+6
est. Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our own versions if they're missing from GLib (as is the case with GLib 1.x). In the code to build the list of named fields for Diameter, don't use g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping in the hash function and use g_ascii_strcasecmp() in the compare function. We do this because there is no guarantee that toupper(), tolower(), and functions that use them will, for example, map between "I" and "i" in all locales; in Turkish locales, for example, there are, in both upper case and lower case, versions of "i" with and without a dot, and the upper-case version of "i" is "I"-with-a-dot and the lower-case version of "I" is "i"-without-a-dot. This causes strings that should match not to match. This finishes fixing bug 2010 - an earlier checkin prevented the crash (as there are other ways to produce the same crash, e.g. a bogus dictionary.xml file), but didn't fix the case-insensitive string matching. svn path=/trunk/; revision=23623
2007-08-04Add a script as a front-end for Flex, to work around various problems,Guy Harris1-0/+1
such as the fact that Flex strips all but the last component of the "-o" argument, and that it doesn't generate a header file to declare routines the generated lexical analyzer defines. Use that script when building lexical analyzers, and, for each lexical analyzer, include the generated header file in the generated analyzer. svn path=/trunk/; revision=22446
2007-07-30Add comments to various %option items to explain what they're doing. Guy Harris1-3/+20
Move the %options to the beginning if they weren't already there, and put them in the same order in all files. Add "prefix=" options to .l files that don't already have them, so we don't have to pass a "-P" option. Add "never-interactive" and "noyywrap" options to our lexical analyzers, to remove extra isatty() checks and to eliminate the need for yywrap() from the Flex library. Get rid of %option nostdinit - that's the default. Add .l.c: rules to Makefile.am files, replacing the rules for specific .l files. Have those rules all check that $(LEX) is set. Update the address for the FSF. svn path=/trunk/; revision=22424
2007-01-15two minor leaksLuis Ontanon1-0/+2
svn path=/trunk/; revision=20443
2006-11-15 solve both issues pointed out in:Luis Ontanon1-1/+1
http://wireshark.org/lists/ethereal-dev/200605/msg02351.html - dtd_parse.l: be more liberal on what a name can be (a number now can be a name) - packet-xml.c if proto-name is given use it instead of the root element name as prefix for generated fields svn path=/trunk/; revision=19903
2006-07-26a better regex for names in DTDsLuis Ontanon1-1/+1
svn path=/trunk/; revision=18795
2006-07-20allow for some uppercasing in names.Luis Ontanon1-1/+1
"fix" for Bug 1010 svn path=/trunk/; revision=18773
2006-05-29Ethereal->WiresharkAnders Broman1-3/+3
svn path=/trunk/; revision=18248
2006-05-22ethereal->wireshark updatesRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18206
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2005-10-07"./dtd_parse.l", line 167: warning, rule cannot be matchedLuis Ontanon1-2/+2
the . matches one char as {special_char} does so {special_char} won't have been matched. change that for a non ">" svn path=/trunk/; revision=16153
2005-10-06remove location from dtd_build_data_t avoiding to (double) free it.Luis Ontanon1-2/+0
svn path=/trunk/; revision=16147
2005-09-24get rid of most dtd leaks.Luis Ontanon1-3/+7
There's just one left I'm aware of (the doctype name). svn path=/trunk/; revision=15990
2005-09-22Make the private variables for various lexical analyzers static, soGuy Harris1-12/+12
that we don't have all the lexical analyzers in libethereal share them (note that they're already static in radius_dict.l, so they weren't sharing with any other lexical analyzer), and so that OS X 10.3.9's run-time linker doesn't get upset at finding them defined in libethereal and the MATE plugin. Fix up indentation. svn path=/trunk/; revision=15961
2005-09-20Fix a couple of errors found by valgrind.Gerald Combs1-1/+2
svn path=/trunk/; revision=15900
2005-09-20 avoid freeing the last location twice.Luis Ontanon1-2/+16
add some #ifed out code to help debugging the parser svn path=/trunk/; revision=15884
2005-09-17Because there's more than just text in XML...Luis Ontanon1-4/+19
DTDs are imported to create fields svn path=/trunk/; revision=15851
2005-09-12Add a header file to declare routines defined in lexer and used inGuy Harris1-5/+2
parser, or vice versa. svn path=/trunk/; revision=15769
2005-09-10the dtd parser (still missing the glue) and few fixes to packet-xml.cLuis Ontanon1-0/+316
svn path=/trunk/; revision=15745