Revision: 110 http://trac.macosforge.org/projects/smartcardservices/changeset/110 Author: ludovic.rousseau@gmail.com Date: 2010-02-02 02:50:08 -0800 (Tue, 02 Feb 2010) Log Message: ----------- GemaltoToken::probe(): correctly NUL-terminate the tokeninfo label Modified Paths: -------------- trunk/Tokend/PKCS11/GemaltoToken.cpp Modified: trunk/Tokend/PKCS11/GemaltoToken.cpp =================================================================== --- trunk/Tokend/PKCS11/GemaltoToken.cpp 2010-02-02 10:44:29 UTC (rev 109) +++ trunk/Tokend/PKCS11/GemaltoToken.cpp 2010-02-02 10:50:08 UTC (rev 110) @@ -390,7 +390,8 @@ score = 500; // Setup the tokendUID - char label[ sizeof(mCKTokenInfo.label) ]; + char label[ sizeof(mCKTokenInfo.label)+1 ]; + label[sizeof(mCKTokenInfo.label)] = '\0'; memcpy( label, mCKTokenInfo.label, sizeof(mCKTokenInfo.label) ); char* trimLabel = trim_line( label ); snprintf(tokenUid, TOKEND_MAX_UID, "Gemalto smartcard %s (%.*s)", trimLabel, (int) sizeof(mCKTokenInfo.serialNumber), mCKTokenInfo.serialNumber );