Author: jmagne
Update of /cvs/dirsec/coolkey/src/coolkey
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26657/src/coolkey
Modified Files:
object.cpp object.h slot.cpp
Log Message:
Misc simple bug fixes: #485032 new/delete mismatch, #250738 , and #497758 problem connecting to token.
Index: object.cpp
===================================================================
RCS file: /cvs/dirsec/coolkey/src/coolkey/object.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- object.cpp 14 Feb 2008 23:48:19 -0000 1.3
+++ object.cpp 16 Sep 2009 23:56:40 -0000 1.4
@@ -397,7 +397,7 @@
{
// clean up old one
if (label) {
- delete label;
+ delete [] label;
label = NULL;
}
// find matching attribute
Index: object.h
===================================================================
RCS file: /cvs/dirsec/coolkey/src/coolkey/object.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- object.h 9 Jun 2006 18:39:11 -0000 1.1
+++ object.h 16 Sep 2009 23:56:40 -0000 1.2
@@ -82,7 +82,7 @@
PKCS11Object(unsigned long muscleObjID, CK_OBJECT_HANDLE handle);
PKCS11Object(unsigned long muscleObjID, const CKYBuffer *data,
CK_OBJECT_HANDLE handle);
- ~PKCS11Object() { delete label; delete name; CKYBuffer_FreeData(&pubKey); }
+ ~PKCS11Object() { delete [] label; delete [] name; CKYBuffer_FreeData(&pubKey); }
PKCS11Object(const PKCS11Object& cpy) :
attributes(cpy.attributes), muscleObjID(cpy.muscleObjID),
Index: slot.cpp
===================================================================
RCS file: /cvs/dirsec/coolkey/src/coolkey/slot.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- slot.cpp 19 Feb 2009 02:04:13 -0000 1.11
+++ slot.cpp 16 Sep 2009 23:56:40 -0000 1.12
@@ -572,7 +572,7 @@
void
Slot::connectToToken()
{
- CKYStatus status;
+ CKYStatus status = CKYSCARDERR;
OSTime time = OSTimeNow();
mCoolkey = 0;
@@ -979,7 +979,7 @@
//
#define COOLKEY "CoolKey"
#define POSSESSION " for "
- if (!personName || personName == "") {
+ if (!personName || personName[0] == '\0' ) {
const int coolKeySize = sizeof(COOLKEY) ;
memcpy(label, COOLKEY, coolKeySize-1);
makeSerialString(&label[coolKeySize], maxSize-coolKeySize, cuid);
@@ -1528,7 +1528,7 @@
}
sprintf(segName,SEGMENT_PREFIX"%s",readerName);
segment = SHMem::initSegment(segName, MAX_OBJECT_STORE_SIZE, needInit);
- delete segName;
+ delete [] segName;
if (!segment) {
// just run without shared memory
return;