Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107845 - Sniffit crashes on processing -s and -t args, not aware of nostrip FFEATURES flag
Summary: Sniffit crashes on processing -s and -t args, not aware of nostrip FFEATURES ...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High critical (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-01 23:10 UTC by Michal Turecki
Modified: 2005-11-26 12:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Turecki 2005-10-01 23:10:41 UTC
Sniffit crashes on strncpy(IP,hlp2,255) in sniffit.0.3.7.c on lines 1645 and 
1660, to-be-tokenized hlp string copied from optarg is a regular ipv4 address 
(as I checked with printf). Tested with and without optimizations. I dunno what 
ipv6 address string format is expected before tokenization with ":", so I can't 
propose solution. Problem is in hlp2=(char *)strtok(hlp,":"), where hlp2 is 
probably NULL when there are no ":" in hlp, so it should be checked before 
strncpy-ing.
Next problem is "strip sniffit" in Makefile.in on line 31, I think it should be 
patched to make sniffit comply the FEATURES="nostrip" flag.

Reproducible: Always
Steps to Reproduce:
emerge sniffit; sniffit -s 127.0.0.1
Actual Results:  
Segmentation fault

Expected Results:  
Sniff =]

Portage 2.0.52-r1 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r1, 2.6.
12-gentoo-r10 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r10 x86_64 AMD Sempron(tm) Processor 2500+
Gentoo Base System version 1.12.0_pre8
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -O3 -march=athlon64 -ffast-math -funit-at-a-time -fpeel-loops -
ftracer -funswitch-loops"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/
X11/xkb /usr/share/config /var/bind /var/qmail/alias /var/qmail/control /var/
vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-pipe -O3 -march=athlon64 -ffast-math -funit-at-a-time -fpeel-loops -
ftracer -funswitch-loops"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.zie.pg.gda.pl ftp://gd.tuwien.ac.at/opsys/linux/
gentoo/ http://mir.zyrianes.net/gentoo/ ftp://ftp.gentoo.mesh-solutions.com/
gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 64bit 7zip X alsa apache2 authfile avi berkdb bitmap-fonts bzip2 
crypt cups eds emboss encode font-server foomaticdb fortran gif gnome gstreamer 
gtk gtk2 imlib ipalias ipv6 jpeg kde libwww lzw lzw-tiff maildir mp3 mpeg mysql 
mysqli ncurses nls notlsbeforeauth nvidia opengl pam pdflib perl php png 
postgres python qt quicktime readline samba sdl sftp sftplogging shaper 
softquota spell sse-filters ssl tcpd tiff truetype-fonts type1-fonts usb 
userlocales vhosts vpopmail xpm xprint xv zlib userland_GNU kernel_linux 
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Marcelo Goes (RETIRED) gentoo-dev 2005-10-02 09:54:08 UTC
I can confirm the problem on amd64, but not on x86.
Comment 2 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2005-11-26 12:21:08 UTC
This is something that should be sent upstream.