summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmagne <jmagne@fba4d07e-fe0f-4d7f-8147-e0026e666dc0>2009-09-16 23:56:40 +0000
committerjmagne <jmagne@fba4d07e-fe0f-4d7f-8147-e0026e666dc0>2009-09-16 23:56:40 +0000
commit81a9d74fa2dfb93fe64971f9941bf374bfcf2523 (patch)
tree1377428731d889468974e417c54432904efd4fcf
parent17c501e98beb2615ab2414f78ae9e14ff8c786ae (diff)
Misc simple bug fixes: #485032 new/delete mismatch, #250738 , and #497758 problem connecting to token.
git-svn-id: http://svn.fedorahosted.org/svn/coolkey/trunk@81 fba4d07e-fe0f-4d7f-8147-e0026e666dc0
-rw-r--r--configure.in4
-rw-r--r--src/coolkey/object.cpp2
-rw-r--r--src/coolkey/object.h2
-rw-r--r--src/coolkey/slot.cpp6
4 files changed, 7 insertions, 7 deletions
diff --git a/configure.in b/configure.in
index 5a7771a..154a4a7 100644
--- a/configure.in
+++ b/configure.in
@@ -124,9 +124,9 @@ then
if test $WINDOWS -ne 1; then
PKG_CHECK_MODULES(NSS, nss, true, [ AC_MSG_ERROR(could not find NSS Crypto libraries) ])
fi
- enable_pk11install = "yes"
+ enable_pk11install="yes"
else
- enable_pk11install = "no"
+ enable_pk11install="no"
AC_MSG_WARN([skipping pk11install])
fi
diff --git a/src/coolkey/object.cpp b/src/coolkey/object.cpp
index 646bcd9..2213dd0 100644
--- a/src/coolkey/object.cpp
+++ b/src/coolkey/object.cpp
@@ -397,7 +397,7 @@ PKCS11Object::getLabel()
{
// clean up old one
if (label) {
- delete label;
+ delete [] label;
label = NULL;
}
// find matching attribute
diff --git a/src/coolkey/object.h b/src/coolkey/object.h
index 9131b1e..7f8719b 100644
--- a/src/coolkey/object.h
+++ b/src/coolkey/object.h
@@ -82,7 +82,7 @@ class PKCS11Object {
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),
diff --git a/src/coolkey/slot.cpp b/src/coolkey/slot.cpp
index 1fb4a0d..b360f02 100644
--- a/src/coolkey/slot.cpp
+++ b/src/coolkey/slot.cpp
@@ -572,7 +572,7 @@ SlotList::getSlotList(CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList,
void
Slot::connectToToken()
{
- CKYStatus status;
+ CKYStatus status = CKYSCARDERR;
OSTime time = OSTimeNow();
mCoolkey = 0;
@@ -979,7 +979,7 @@ Slot::makeLabelString(char *label, int maxSize, const unsigned char *cuid)
//
#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 @@ SlotMemSegment::SlotMemSegment(const char *readerName):
}
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;