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: do not invert a NULL cp_list #13832

Closed
p5pRT opened this issue May 13, 2014 · 5 comments
Closed

[PATCH] Coverity: do not invert a NULL cp_list #13832

p5pRT opened this issue May 13, 2014 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented May 13, 2014

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

Searchable as RT121864$

@p5pRT
Copy link
Author

p5pRT commented May 13, 2014

From @jhi

Coverity found a spot where a NULL cp_list (invlist used in encoding
Unicode properties) might have unintentionally become inverted (inducing
an assert crash). The code didn't currently attempt to do that, but
better play safe and add "cp_list &&".

Patch attached.

@p5pRT
Copy link
Author

p5pRT commented May 13, 2014

From @jhi

0001-Do-not-invert-a-NULL-cp_list.patch
From d3c3ed72bc22ad89c3f754a4e556970f6e70d063 Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Fri, 9 May 2014 11:05:30 -0400
Subject: [PATCH] Do not invert a NULL cp_list.

Fix for Coverity perl5 CID 28966.
---
 regcomp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/regcomp.c b/regcomp.c
index 920f7cb..d5b7679 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -14635,7 +14635,8 @@ parseit:
      * at compile time.  Besides not inverting folded locale now, we can't
      * invert if there are things such as \w, which aren't known until runtime
      * */
-    if (invert
+    if (cp_list
+        && invert
         && ! (ANYOF_FLAGS(ret) & (ANYOF_LOCALE_FLAGS))
 	&& ! depends_list
 	&& ! HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION)
-- 
1.9.2

@p5pRT
Copy link
Author

p5pRT commented May 28, 2014

From @tsee

Thanks, applied as e76fdeb.

@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
None yet
Projects
None yet
Development

No branches or pull requests

1 participant