summaryrefslogtreecommitdiff
path: root/lib/softoken
diff options
context:
space:
mode:
authorNoah Lokocz <nlokocz@mozilla.com>2023-03-16 11:54:55 +0000
committerNoah Lokocz <nlokocz@mozilla.com>2023-03-16 11:54:55 +0000
commit8acd95e85e0da102fc48369fd237c634fe6066ae (patch)
tree8e1a4dd99d6d370965a7a8a1db41dbde878a0997 /lib/softoken
parentf658c5a831dab0cf861a0c939c0684f0ab012695 (diff)
downloadnss-hg-8acd95e85e0da102fc48369fd237c634fe6066ae.tar.gz
Bug 1819958. Removed deprecated sprintf function and replaced with snprintf. r=djackson
Differential Revision: https://phabricator.services.mozilla.com/D171859
Diffstat (limited to 'lib/softoken')
-rw-r--r--lib/softoken/pkcs11.c6
-rw-r--r--lib/softoken/sftkdb.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/softoken/pkcs11.c b/lib/softoken/pkcs11.c
index ab71e60cc..e9dc09acf 100644
--- a/lib/softoken/pkcs11.c
+++ b/lib/softoken/pkcs11.c
@@ -1714,7 +1714,7 @@ sftk_handleObject(SFTKObject *object, SFTKSession *session)
* token objects and will have a token object handle assigned to
* them by a call to sftk_mkHandle in the handler for each object
* class, invoked below.
- *
+ *
* It may be helpful to note/remember that
* sftk_narrowToXxxObject uses sftk_isToken,
* sftk_isToken examines the sign bit of the object's handle, but
@@ -2568,7 +2568,7 @@ sftk_getDefTokName(CK_SLOT_ID slotID)
default:
break;
}
- sprintf(buf, "NSS Application Token %08x ", (unsigned int)slotID);
+ snprintf(buf, sizeof(buf), "NSS Application Token %08x ", (unsigned int)slotID);
return buf;
}
@@ -2587,7 +2587,7 @@ sftk_getDefSlotName(CK_SLOT_ID slotID)
default:
break;
}
- sprintf(buf,
+ snprintf(buf, sizeof(buf),
"NSS Application Slot %08x ",
(unsigned int)slotID);
return buf;
diff --git a/lib/softoken/sftkdb.c b/lib/softoken/sftkdb.c
index bd6e41aa8..90d49304d 100644
--- a/lib/softoken/sftkdb.c
+++ b/lib/softoken/sftkdb.c
@@ -255,7 +255,7 @@ sftkdb_getRawAttributeSignature(SFTKDBHandle *handle, SDB *db,
char id[30];
CK_RV crv;
- sprintf(id, SFTKDB_META_SIG_TEMPLATE,
+ snprintf(id, sizeof(id), SFTKDB_META_SIG_TEMPLATE,
sftkdb_TypeString(handle),
(unsigned int)objectID, (unsigned int)type);
@@ -280,7 +280,7 @@ sftkdb_DestroyAttributeSignature(SFTKDBHandle *handle, SDB *db,
char id[30];
CK_RV crv;
- sprintf(id, SFTKDB_META_SIG_TEMPLATE,
+ snprintf(id, sizeof(id), SFTKDB_META_SIG_TEMPLATE,
sftkdb_TypeString(handle),
(unsigned int)objectID, (unsigned int)type);
@@ -306,7 +306,7 @@ sftkdb_PutAttributeSignature(SFTKDBHandle *handle, SDB *keyTarget,
char id[30];
CK_RV crv;
- sprintf(id, SFTKDB_META_SIG_TEMPLATE,
+ snprintf(id, sizeof(id), SFTKDB_META_SIG_TEMPLATE,
sftkdb_TypeString(handle),
(unsigned int)objectID, (unsigned int)type);
@@ -2325,7 +2325,7 @@ sftkdb_updateIntegrity(PLArenaPool *arena, SFTKDBHandle *handle,
crv = sftkdb_getRawAttributeSignature(handle, source, sourceID, type,
&signature);
if (crv != CKR_OK) {
- /* old databases don't have signature IDs because they are
+ /* old databases don't have signature IDs because they are
* 3DES encrypted. Since we know not to look for integrity
* for 3DES records it's OK not to find one here. A new record
* will be created when we reencrypt using AES CBC */