Bug 92434

Summary: Expression 'call_id < 0' is always false
Product: p11-glue Reporter: Pankaj <pankaj.s01>
Component: p11-kitAssignee: Stef Walter <stefw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: stefw
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: p11-kit-0.23.1-rpc-message

Description Pankaj 2015-10-12 05:12:03 UTC
Created attachment 118830 [details] [review]
p11-kit-0.23.1-rpc-message

Hi, 
The issues reported for logically - 'always false' in the code.
where 'call_id' is type of uint32_t which never will be less than 0;
at line  :p11-kit-0.23.1/p11-kit/rpc-message.c:171

the respective patch has been also attached ,please review it .
===============================================================
--- a/p11-kit-0.23.1/p11-kit/rpc-message.c      2014-12-16 15:54:01.000000000 +0530
+++ b/p11-kit-0.23.1/p11-kit/rpc-message.c      2015-10-12 10:12:27.733046227 +0530
@@ -171,7 +171,7 @@
        msg->signature = msg->sigverify = NULL;

        /* The call id and signature */
-       if (call_id < 0 || call_id >= P11_RPC_CALL_MAX) {
+       if (call_id >= P11_RPC_CALL_MAX) {
                p11_message ("invalid message: bad call id: %d", call_id);
                return false;
        }

Thanks ,
Pankaj Sharma
Comment 1 Stef Walter 2015-10-19 08:19:39 UTC
Thanks. Pushed to git master.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.