projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AlgorithmIdentifier bugs
[oweals/openssl.git]
/
crypto
/
cryptlib.c
diff --git
a/crypto/cryptlib.c
b/crypto/cryptlib.c
index 070cf59690fa5123e4342d6a2daa5176a604f02b..8fd2d4d26b82a73eab02843913f659585bdceb61 100644
(file)
--- a/
crypto/cryptlib.c
+++ b/
crypto/cryptlib.c
@@
-90,6
+90,7
@@
static const char* lock_names[CRYPTO_NUM_LOCKS] =
"ssl_sess_cert",
"ssl",
"rand",
"ssl_sess_cert",
"ssl",
"rand",
+ "rand2",
"debug_malloc",
"BIO",
"gethostbyname",
"debug_malloc",
"BIO",
"gethostbyname",
@@
-100,7
+101,7
@@
static const char* lock_names[CRYPTO_NUM_LOCKS] =
"debug_malloc2",
"dso",
"dynlock",
"debug_malloc2",
"dso",
"dynlock",
-#if CRYPTO_NUM_LOCKS != 2
8
+#if CRYPTO_NUM_LOCKS != 2
9
# error "Inconsistency between crypto.h and cryptlib.c"
#endif
};
# error "Inconsistency between crypto.h and cryptlib.c"
#endif
};
@@
-227,7
+228,10
@@
void CRYPTO_destroy_dynlockid(int i)
CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
+ {
+ CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
return;
return;
+ }
pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
if (pointer != NULL)
{
pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
if (pointer != NULL)
{
@@
-240,7
+244,7
@@
void CRYPTO_destroy_dynlockid(int i)
}
else
#endif
}
else
#endif
- if (
--(pointer->references)
<= 0)
+ if (
pointer->references
<= 0)
{
sk_CRYPTO_dynlock_set(dyn_locks, i, NULL);
}
{
sk_CRYPTO_dynlock_set(dyn_locks, i, NULL);
}
@@
-399,7
+403,7
@@
void CRYPTO_lock(int mode, int type, const char *file, int line)
struct CRYPTO_dynlock_value *pointer
= CRYPTO_get_dynlock_value(i);
struct CRYPTO_dynlock_value *pointer
= CRYPTO_get_dynlock_value(i);
- if (pointer)
+ if (pointer
&& dynlock_lock_callback
)
{
dynlock_lock_callback(mode, pointer, file, line);
}
{
dynlock_lock_callback(mode, pointer, file, line);
}
@@
-430,7
+434,6
@@
int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
CRYPTO_get_lock_name(type),
file,line);
#endif
CRYPTO_get_lock_name(type),
file,line);
#endif
- *pointer=ret;
}
else
{
}
else
{