Debian Bug report logs - #695312
tcpick write.c seg

version graph

Package: tcpick; Maintainer for tcpick is Debian Security Tools Packaging Team <pkg-security-team@lists.alioth.debian.org>; Source for tcpick is src:tcpick (PTS, buildd, popcon).

Reported by: "Dr. David Alan Gilbert" <dave@treblig.org>

Date: Thu, 6 Dec 2012 22:09:01 UTC

Severity: normal

Found in version tcpick/0.2.1-6

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, William Vera <billy@billy.com.mx>:
Bug#695312; Package tcpick. (Thu, 06 Dec 2012 22:09:04 GMT) (full text, mbox, link).


Acknowledgement sent to "Dr. David Alan Gilbert" <dave@treblig.org>:
New Bug report received and forwarded. Copy sent to William Vera <billy@billy.com.mx>. (Thu, 06 Dec 2012 22:09:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: "Dr. David Alan Gilbert" <dave@treblig.org>
To: submit@bugs.debian.org
Subject: tcpick write.c seg
Date: Thu, 6 Dec 2012 22:05:38 +0000
Package: tcpick
Version: 0.2.1-6

This started out life as Ubuntu bug :
https://bugs.launchpad.net/ubuntu/+source/tcpick/+bug/1026902

The user reported that they can trigger a seg by running

tcpick -wRC -wRS -r afile.pcap

looking at write.c:avail_filename  there are multiple problems:

        servername=(char *)lookup(conn_ptr->server.ip);
        sprintf(client_server,"%s_%s_%s",
                client_server,
                servername,
                getportname(server_port)
                );

is the line that segs; note that it's using a parameter (client_server)
as the output string; according to sprintf manpage this is sanely
disallowed in C99 (and on Ubuntu segs, how this ever works on debian
is beyond me....)

Secondly; client_server is a fixed length calloc'd buffer; I don't see
anything that's ensuring there are now overruns, especially given that
the names seem to be lookups in DNS(?) and textual portnames. (Although
perhaps it happens to be sized large enough based on allowed limits of those??)

Dave

-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\ gro.gilbert @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 12 07:21:34 2018; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.