Wireshark-bugs: [Wireshark-bugs] [Bug 3339] New: g_[v]snprintf() and NUL termination
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3339
Summary: g_[v]snprintf() and NUL termination
Product: Wireshark
Version: SVN
Platform: All
OS/Version: All
Status: NEW
Severity: Trivial
Priority: Low
Component: Wireshark
AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
ReportedBy: darkjames@xxxxxxxxxxxxxxxx
Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #2870| |review_for_checkin?
Flag| |
Created an attachment (id=2870)
--> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=2870)
clean usage of g_snprintf() & g_vsnprintf()
Build Information:
wireshark 1.1.3
Copyright 1998-2009 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiled with GTK+ 2.14.7, with GLib 2.18.4, with libpcap 1.0.0, with libz
1.2.3, without POSIX capabilities, with libpcre 7.8, without SMI, with c-ares
1.4.0, without Lua, with GnuTLS 2.6.3, with Gcrypt 1.4.4, without Kerberos,
without GeoIP, with PortAudio <= V18, without AirPcap.
Running on Linux 2.6.28-dark64, with libpcap version 1.0.0, GnuTLS 2.6.3,
Gcrypt
1.4.4.
Built using gcc 4.1.2 (Gentoo 4.1.2).
--
g_snprintf() [1] and g_vsnprintf() [2] since glib 1.3.12 doesn't return -1, and
always NUL terminate the string.
We can clean sources by removing dead/unnecessary code.
In few places I also fix size of buffer to sizeof(buffer) [instead of
sizeof()-1]
(btw. Maybe it's worth to change all of them to sizeof(foo)?)
[1] -
http://library.gnome.org/devel/glib/2.20/glib-String-Utility-Functions.html#g-snprintf
[2] -
http://library.gnome.org/devel/glib/2.20/glib-String-Utility-Functions.html#g-vsnprintf
--
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.