From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from acme.spoerlein.net (acme.spoerlein.net [88.198.49.12]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id r4H1bejH016226 for ; Thu, 16 May 2013 21:37:41 -0400 (EDT) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.7/8.14.6) with ESMTP id r4H1bdkN031290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 17 May 2013 03:37:39 +0200 (CEST) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1368754659; bh=5x/Y1vMpam5YmmZ52qmxZg49XqQAhzSWTn6OFIEsQBE=; h=Date:From:To:Subject; b=aiwccqQjzkQDbqoNcFFFU9y1+UYYy60Iw6vV+XdBGPdAvOSHccW+526zd3eck4zdP NR2+sSdF/dxkuhysjF6Kq/iLBRDBES6H1EjGWgAiyBVIhlPTnc6JN0eRKv3WP2uSab zR6vVGEMsLCuR8z5+8FqpLad2OgAigYL1xxhmKH4= Date: Fri, 17 May 2013 03:37:39 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: tech@mdocml.bsd.lv Subject: [patch] avoid possible null pointer dereference Message-ID: <20130517013739.GZ2055@acme.spoerlein.net> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cN519qCC4CN1mUcX" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) --cN519qCC4CN1mUcX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline And the last one, termp_xx_pre() will call term_word() with NULL when the switch case falls through to the default case. There are several ways to avoid the segfault, not sure this is the best one. This is Coverity Scan CID 976115. Cheers, Uli --cN519qCC4CN1mUcX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="mdoc_term.diff" Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.245 diff -u -p -r1.245 mdoc_term.c --- mdoc_term.c 17 Nov 2012 00:26:33 -0000 1.245 +++ mdoc_term.c 17 May 2013 01:32:03 -0000 @@ -1756,7 +1756,7 @@ termp_xx_pre(DECL_ARGS) pp = "UNIX"; break; default: - break; + return(0); } term_word(p, pp); --cN519qCC4CN1mUcX-- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv