Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
opensc
opensc-serialno-vulnerability.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File opensc-serialno-vulnerability.patch of Package opensc
Index: /trunk/src/libopensc/card-atrust-acos.c =================================================================== --- /trunk/src/libopensc/card-atrust-acos.c (revision 4706) +++ /trunk/src/libopensc/card-atrust-acos.c (revision 4913) @@ -843,6 +843,6 @@ return SC_ERROR_INTERNAL; /* cache serial number */ - memcpy(card->serialnr.value, apdu.resp, apdu.resplen); - card->serialnr.len = apdu.resplen; + memcpy(card->serialnr.value, apdu.resp, MIN(apdu.resplen, SC_MAX_SERIALNR)); + card->serialnr.len = MIN(apdu.resplen, SC_MAX_SERIALNR); /* copy and return serial number */ memcpy(serial, &card->serialnr, sizeof(*serial)); Index: /trunk/src/libopensc/card-starcos.c =================================================================== --- /trunk/src/libopensc/card-starcos.c (revision 4706) +++ /trunk/src/libopensc/card-starcos.c (revision 4913) @@ -1280,6 +1280,6 @@ return SC_ERROR_INTERNAL; /* cache serial number */ - memcpy(card->serialnr.value, apdu.resp, apdu.resplen); - card->serialnr.len = apdu.resplen; + memcpy(card->serialnr.value, apdu.resp, MIN(apdu.resplen, SC_MAX_SERIALNR)); + card->serialnr.len = MIN(apdu.resplen, SC_MAX_SERIALNR); /* copy and return serial number */ memcpy(serial, &card->serialnr, sizeof(*serial)); Index: /trunk/src/libopensc/card-acos5.c =================================================================== --- /trunk/src/libopensc/card-acos5.c (revision 4118) +++ /trunk/src/libopensc/card-acos5.c (revision 4913) @@ -139,6 +139,6 @@ * Cache serial number. */ - memcpy(card->serialnr.value, apdu.resp, apdu.resplen); - card->serialnr.len = apdu.resplen; + memcpy(card->serialnr.value, apdu.resp, MIN(apdu.resplen, SC_MAX_SERIALNR)); + card->serialnr.len = MIN(apdu.resplen, SC_MAX_SERIALNR); /* Index: /trunk/src/libopensc/internal.h =================================================================== --- /trunk/src/libopensc/internal.h (revision 4902) +++ /trunk/src/libopensc/internal.h (revision 4912) @@ -48,4 +48,11 @@ #define msleep(t) Sleep(t) #define sleep(t) Sleep((t) * 1000) +#endif + +#ifndef MAX +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) +#endif +#ifndef MIN +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) #endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor