RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1161039 - Unchecked return value of libvirt_uintUnwrap in libvirt_virDomainSendKey
Summary: Unchecked return value of libvirt_uintUnwrap in libvirt_virDomainSendKey
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-python
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-06 08:58 UTC by Jiri Denemark
Modified: 2015-03-05 07:57 UTC (History)
4 users (show)

Fixed In Version: libvirt-python-1.2.8-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:57:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0334 0 normal SHIPPED_LIVE new packages: libvirt-python 2015-03-05 12:23:16 UTC

Description Jiri Denemark 2014-11-06 08:58:54 UTC
Description of problem:

Coverity correctly complains that the return value of libvirt_uintUnwrap() called from libvirt_virDomainSendKey is not checked:

http://cov01.lab.eng.brq.redhat.com/covscanhub/waiving/7015/21728/#defects

Version-Release number of selected component (if applicable):

libvirt-python-1.2.8-4.el7

How reproducible:

100%

Steps to Reproduce:
1. look at the code or coverity output

Actual results:

Return value is not checked.

Expected results:

All return values of libvirt_uintUnwrap() are checked.

Additional info:

Comment 1 Jiri Denemark 2014-11-06 11:13:58 UTC
Pushed upstream as v1.2.10-2-g8dcdc7f:

commit 8dcdc7f2b4d8ebe7c892a2f92c23f77c59106189
Author: Jiri Denemark <jdenemar>
Date:   Thu Nov 6 10:20:40 2014 +0100

    Check return value of libvirt_uintUnwrap
    
    libvirt_virDomainSendKey didn't check whether libvirt_uintUnwrap
    succeeded or not.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1161039
    Signed-off-by: Jiri Denemark <jdenemar>

Comment 4 Luyao Huang 2014-11-12 02:33:59 UTC
I can reproduce this bug with libvrt-python-1.2.8-4.el7 :

# cat sendkey.py

import libvirt

conn = libvirt.open()
domain = conn.lookupByName('test3')
print domain.sendKey(0, 0, [12], 1)
print domain.sendKey(0, 0, ['12'], 1)


# python sendkey.py 
0
0

And verify this bug with libvirt-python-1.2.8-5.el7:

# python sendkey.py 
0
Traceback (most recent call last):
  File "sendkey.py", line 8, in <module>
    print domain.sendKey(0, 0, ['12'], 1)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2048, in sendKey
    ret = libvirtmod.virDomainSendKey(self._o, codeset, holdtime, keycodes, nkeycodes, flags)
TypeError: an integer is required


Output TypeError so verify this bug.

Comment 6 errata-xmlrpc 2015-03-05 07:57:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0334.html


Note You need to log in before you can comment on or make changes to this bug.