Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 105476
Status: open
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: JHI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.42
Fixed in: (no value)

Attachments
0001-assert-cv-before-CvISXSUB-cv.patch



Subject: Coverity finding: potential null cv derefs with MULTICALL
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 744
Download (untitled) / with headers
text/plain 744b
Three of them: ListUtil.xs. ... 623 #ifdef dMULTICALL CID 118702 (#1 of 1): Dereference null return value (NULL_RETURNS) 20. dereference: Dereferencing a null pointer cv. 624 if(!CvISXSUB(cv)) { ... 706 #ifdef dMULTICALL CID 118703 (#1 of 1): Dereference null return value (NULL_RETURNS) 20. dereference: Dereferencing a null pointer cv. 707 if(!CvISXSUB(cv)) ... 795 #if defined(dMULTICALL) && (PERL_BCDVERSION > 0x5010000 || PERL_BCDVERSION < 0x5008009) CID 118704 (#1 of 1): Dereference null return value (NULL_RETURNS) 20. dereference: Dereferencing a null pointer cv. 796 if(!CvISXSUB(cv)) { The usual trick to silence Coverity is to add assert(foo) before each potential deref, that way it believes we care.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-3361-1454534250-971.105476-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 5
Ping.
MIME-Version: 1.0
Subject: [PATCH] Coverity finding: potential null cv derefs with MULTICALL
In-Reply-To: <rt-4.0.18-3361-1454534250-971.105476-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
X-RT-Interface: Web
References: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org> <rt-4.0.18-3361-1454534250-971.105476-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1454718522-9365-6"
Message-ID: <rt-4.0.18-9365-1454718522-40.105476-0-0 [...] rt.cpan.org>
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 49
On Wed Feb 03 16:17:30 2016, JHI wrote: Show quoted text
> Ping.
MIME-Version: 1.0
Subject: 0001-assert-cv-before-CvISXSUB-cv.patch
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Type: application/octet-stream; name="0001-assert-cv-before-CvISXSUB-cv.patch"
Content-Disposition: inline; filename="0001-assert-cv-before-CvISXSUB-cv.patch"
Content-Transfer-Encoding: base64
Content-Length: 1831
From afca80d8e844b800435a2e748f3dce8e6e0d38c5 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi <jhi@iki.fi> Date: Fri, 5 Feb 2016 19:25:56 -0500 Subject: [PATCH] assert(cv) before CvISXSUB(cv). Coverity CID 118702, 118703, 118704. --- cpan/Scalar-List-Utils/ListUtil.xs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpan/Scalar-List-Utils/ListUtil.xs b/cpan/Scalar-List-Utils/ListUtil.xs index 504c70e..c155e8e 100644 --- a/cpan/Scalar-List-Utils/ListUtil.xs +++ b/cpan/Scalar-List-Utils/ListUtil.xs @@ -323,6 +323,7 @@ CODE: GvSV(agv) = ret; SvSetMagicSV(ret, args[1]); #ifdef dMULTICALL + assert(cv); if(!CvISXSUB(cv)) { dMULTICALL; I32 gimme = G_SCALAR; @@ -377,6 +378,7 @@ CODE: SAVESPTR(GvSV(PL_defgv)); #ifdef dMULTICALL + assert(cv); if(!CvISXSUB(cv)) { dMULTICALL; I32 gimme = G_SCALAR; @@ -443,6 +445,7 @@ PPCODE: SAVESPTR(GvSV(PL_defgv)); #ifdef dMULTICALL + assert(cv); if(!CvISXSUB(cv)) { dMULTICALL; I32 gimme = G_SCALAR; @@ -621,6 +624,7 @@ PPCODE: SAVESPTR(GvSV(agv)); SAVESPTR(GvSV(bgv)); #ifdef dMULTICALL + assert(cv); if(!CvISXSUB(cv)) { /* Since MULTICALL is about to move it */ SV **stack = PL_stack_base + ax; @@ -704,6 +708,7 @@ PPCODE: SAVESPTR(GvSV(agv)); SAVESPTR(GvSV(bgv)); #ifdef dMULTICALL + assert(cv); if(!CvISXSUB(cv)) { /* Since MULTICALL is about to move it */ SV **stack = PL_stack_base + ax; @@ -793,6 +798,7 @@ PPCODE: * Skip it on those versions (RT#87857) */ #if defined(dMULTICALL) && (PERL_BCDVERSION > 0x5010000 || PERL_BCDVERSION < 0x5008009) + assert(cv); if(!CvISXSUB(cv)) { /* Since MULTICALL is about to move it */ SV **stack = PL_stack_base + ax; -- 2.7.0
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-9365-1454718522-40.105476-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org> <rt-4.0.18-3361-1454534250-971.105476-0-0 [...] rt.cpan.org> <rt-4.0.18-9365-1454718522-40.105476-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-27489-1463184586-1929.105476-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 107
Download (untitled) / with headers
text/plain 107b
On Fri Feb 05 19:28:42 2016, JHI wrote: Show quoted text
> On Wed Feb 03 16:17:30 2016, JHI wrote:
> > Ping.
>
Ping ping.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-22687-1472418887-1707.105476-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 15
PING PING PING
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-22687-1472418887-1707.105476-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-17456-1435197030-1068.0-0-0 [...] rt.cpan.org> <rt-4.0.18-22687-1472418887-1707.105476-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-18239-1472420281-863.105476-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 36
Hello. seems good. -- Paul Evans


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.