strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 27 Nov 2007 18:52:51 +0000 (18:52 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 27 Nov 2007 18:52:51 +0000 (18:52 +0000)
commit4d005106f956ff792cd46cb90050f5ebf13f133e
tree593646c7e1eb44302243659672c5fc691f0d4272
parent3a9435a5c8f4833aeebc0a120f4fd0657e25db3e
strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23623 f5534014-38df-0310-8fa8-9805f1628bb7
57 files changed:
airpcap_loader.c
capture-wpcap.c
capture_loop.c
configure.in
epan/Makefile.am
epan/crypt/airpdcap.c
epan/dfilter/semcheck.c
epan/dissectors/packet-3com-njack.c
epan/dissectors/packet-afp.c
epan/dissectors/packet-cigi.c
epan/dissectors/packet-diameter.c
epan/dissectors/packet-edonkey.c
epan/dissectors/packet-giop.c
epan/dissectors/packet-http.c
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-ipsec.c
epan/dissectors/packet-megaco.c
epan/dissectors/packet-mgcp.c
epan/dissectors/packet-multipart.c
epan/dissectors/packet-pvfs2.c
epan/dissectors/packet-rtcp.c
epan/dissectors/packet-rtsp.c
epan/dissectors/packet-sccp.c
epan/dissectors/packet-sip.c
epan/dissectors/packet-smtp.c
epan/dissectors/packet-sqloracle.c
epan/dissectors/packet-tftp.c
epan/dissectors/packet-tivoconnect.c
epan/dissectors/packet-vnc.c
epan/dissectors/packet-wbxml.c
epan/dissectors/packet-wsp.c
epan/dissectors/packet-xml.c
epan/dtd_parse.l
epan/g_ascii_strcasecmp.c [new file with mode: 0644]
epan/g_ascii_strcasecmp.h [new file with mode: 0644]
epan/prefs.c
epan/proto.c
epan/req_resp_hdrs.c
epan/strutil.c
epan/tvbuff.c
epan/tvbuff.h
gtk/airpcap_dlg.c
gtk/airpcap_gui_utils.c
gtk/capture_if_dlg.c
gtk/decode_as_dlg.c
gtk/expert_comp_table.c
gtk/gui_utils.c
gtk/main.c
gtk/menu.c
gtk/mgcp_stat.c
gtk/prefs_dlg.c
gtk/recent.c
gtk/rtp_analysis.c
gtk/voip_calls.c
plugins/mgcp/packet-mgcp.c
tap-mgcpstat.c
util.c