Bug 1037715 - opensc: minor overflow leading to big-endian compatibility issue
Summary: opensc: minor overflow leading to big-endian compatibility issue
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: opensc
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nikos Mavrogiannopoulos
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1036175
TreeView+ depends on / blocked
 
Reported: 2013-12-03 16:15 UTC by Florian Weimer
Modified: 2015-08-26 14:38 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-26 14:38:14 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Florian Weimer 2013-12-03 16:15:31 UTC
Clang warns about this:

opensc-explorer.c:309:33: warning: format specifies type 'unsigned int *' but the argument has type 'u8 *' (aka 'unsigned char *') [-Wformat]
    if (sscanf(arg, "%02X%02X", &fid[0], &fid[1]) != 2) {
                     ~~~~       ^~~~~~~
                     %2s
opensc-explorer.c:309:42: warning: format specifies type 'unsigned int *' but the argument has type 'u8 *' (aka 'unsigned char *') [-Wformat]
    if (sscanf(arg, "%02X%02X", &fid[0], &fid[1]) != 2) {
                         ~~~~            ^~~~~~~
                         %2s

This writes useful values to fid[0] and fid[1] on little-endian architectures, and zero on big-endian architectures.

Comment 4 Nikos Mavrogiannopoulos 2014-06-05 09:47:48 UTC
This has been addressed in the following upstream commit:
https://github.com/OpenSC/OpenSC/commit/1a972920f0dd4959bd6ec3c4cddef2d98e6009a8


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