Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Coverity: utf8.c: slen can be accessed uninitialized #13755

Closed
p5pRT opened this issue Apr 23, 2014 · 7 comments
Closed

[PATCH] Coverity: utf8.c: slen can be accessed uninitialized #13755

p5pRT opened this issue Apr 23, 2014 · 7 comments
Labels

Comments

@p5pRT
Copy link

p5pRT commented Apr 23, 2014

Migrated from rt.perl.org#121706 (status was 'resolved')

Searchable as RT121706$

@p5pRT
Copy link
Author

p5pRT commented Apr 23, 2014

From @jhi

Attached.

@p5pRT
Copy link
Author

p5pRT commented Apr 23, 2014

From @jhi

0003-Fix-for-Coverity-perl5-CID-29081.patch
From 36b085b3d9620d78c61f2824a166661f7f4f4def Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Mon, 21 Apr 2014 21:08:41 -0400
Subject: [PATCH 3/9] Fix for Coverity perl5 CID 29081: Uninitialized scalar
 variable (UNINIT) uninit_use_in_call: Using uninitialized value slen when
 calling Perl_croak.

If all fails, slen hasn't been set, and croak will be called with that.
---
 utf8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utf8.c b/utf8.c
index fa5b4a7..7facd62 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2806,7 +2806,7 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8)
     HV *const hv = MUTABLE_HV(SvRV(swash));
     U32 klen;
     U32 off;
-    STRLEN slen;
+    STRLEN slen = 0;
     STRLEN needents;
     const U8 *tmps = NULL;
     U32 bit;
-- 
1.8.5.2 (Apple Git-48)

@p5pRT
Copy link
Author

p5pRT commented May 7, 2014

From @jhi

On Tuesday-201404-22, 20​:24, perlbug-followup@​perl.org wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a perl bug report regarding​:
"[PATCH] Coverity​: utf8.c​: slen can be accessed uninitialized".

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #121706].

You can view your ticket at
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121706

Within the next 24 to 72 hours, your message will be posted to the Perl 5 Porters mailing list. Please be patient!

Better summary line, patch attached.

@p5pRT
Copy link
Author

p5pRT commented May 7, 2014

From @jhi

0001-slen-may-be-uninitialized.patch
From 97a73c930d1b5244615da6679586609eb34070c8 Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Wed, 7 May 2014 09:25:04 -0400
Subject: [PATCH] slen may be uninitialized.

Fix for Coverity perl5 CID 29081: Uninitialized scalar
variable (UNINIT) uninit_use_in_call: Using uninitialized value slen when
calling Perl_croak.

If all fails, slen hasn't been set, and croak will be called with that.
---
 utf8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utf8.c b/utf8.c
index dab5387..85443d6 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2808,7 +2808,7 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8)
     HV *const hv = MUTABLE_HV(SvRV(swash));
     U32 klen;
     U32 off;
-    STRLEN slen;
+    STRLEN slen = 0;
     STRLEN needents;
     const U8 *tmps = NULL;
     U32 bit;
-- 
1.9.2

@p5pRT
Copy link
Author

p5pRT commented May 28, 2014

From @tsee

Thanks, applied as 9b56a01.

@p5pRT
Copy link
Author

p5pRT commented May 28, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 28, 2014

@tsee - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant