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
Comments
From @jhiAttached. |
From @jhi0003-Fix-for-Coverity-perl5-CID-29081.patchFrom 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)
|
From @jhiOn Tuesday-201404-22, 20:24, perlbug-followup@perl.org wrote:
Better summary line, patch attached. |
From @jhi0001-slen-may-be-uninitialized.patchFrom 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
|
The RT System itself - Status changed from 'new' to 'open' |
@tsee - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#121706 (status was 'resolved')
Searchable as RT121706$
The text was updated successfully, but these errors were encountered: