mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bugzilla Bug 298906 really check in the patch to the tip, not a test branch
crash when accepting new certificate permanently on taschenonkel.de r=wtc, r=nelson
This commit is contained in:
parent
e4ab6fa7bb
commit
f7cb169d0a
@ -37,7 +37,7 @@
|
||||
/*
|
||||
* Permanent Certificate database handling code
|
||||
*
|
||||
* $Id: pcertdb.c,v 1.49 2005/03/29 18:21:18 nelsonb%netscape.com Exp $
|
||||
* $Id: pcertdb.c,v 1.50 2005/08/01 20:41:30 relyea%netscape.com Exp $
|
||||
*/
|
||||
#include "prtime.h"
|
||||
|
||||
@ -388,17 +388,25 @@ pkcs11_freeStaticData (unsigned char *data, unsigned char *space)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char *
|
||||
pkcs11_allocStaticData(int len, unsigned char *space, int spaceLen)
|
||||
{
|
||||
unsigned char *data = NULL;
|
||||
|
||||
if (len <= spaceLen) {
|
||||
data = space;
|
||||
} else {
|
||||
data = (unsigned char *) PORT_Alloc(len);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
unsigned char *
|
||||
pkcs11_copyStaticData(unsigned char *data, int len,
|
||||
unsigned char *space, int spaceLen)
|
||||
{
|
||||
unsigned char *copy = NULL;
|
||||
|
||||
if (len <= spaceLen) {
|
||||
copy = space;
|
||||
} else {
|
||||
copy = (unsigned char *) PORT_Alloc(len);
|
||||
}
|
||||
unsigned char *copy = pkcs11_allocStaticData(len, space, spaceLen);
|
||||
if (copy) {
|
||||
PORT_Memcpy(copy,data,len);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user