Navigation Menu

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] NDBM_File.xs: (const char*) for %s #13844

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

[PATCH] NDBM_File.xs: (const char*) for %s #13844

p5pRT opened this issue May 15, 2014 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented May 15, 2014

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

Searchable as RT121881$

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

From @jhi

This is perhaps the most trivial of Coverity findings... a cast to make
a void* more acceptable for printf %s. Patch attached.

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

From @jhi

0001-Printfed-as-s-cast-appropriately.patch
From ab0d9ab86014cde8dfafbad147f1d4d38144ab24 Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Thu, 8 May 2014 17:17:02 -0400
Subject: [PATCH] Printfed as %s, cast appropriately.

Fix for Coverity perl5 CID 29050.
---
 ext/NDBM_File/NDBM_File.xs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs
index 52e60fc..af25c6c 100644
--- a/ext/NDBM_File/NDBM_File.xs
+++ b/ext/NDBM_File/NDBM_File.xs
@@ -109,7 +109,7 @@ ndbm_STORE(db, key, value, flags = DBM_REPLACE)
 	    if (RETVAL < 0 && errno == EPERM)
 		croak("No write permission to ndbm file");
 	    croak("ndbm store returned %d, errno %d, key \"%s\"",
-			RETVAL,errno,key.dptr);
+                  RETVAL, errno, (const char*)key.dptr);
 	    dbm_clearerr(db->dbp);
 	}
 
-- 
1.9.2

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2014

From @tonycoz

On Thu May 15 08​:43​:22 2014, jhi wrote​:

This is perhaps the most trivial of Coverity findings... a cast to make
a void* more acceptable for printf %s. Patch attached.

Applied by Jarkko as b8c610e.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2014

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

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2014

@tonycoz - 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