Skip to content

Fix HMAC memory issue #1253

@farshadasl

Description

@farshadasl

If the keyNative is NULL, then this line should not be called

result = HMAC_init_internal(ockCtx, ockHMAC, keyNative, keySize);

It should be in the else block like this:

if (NULL == keyNative) {
...
} else {
  result = HMAC_init_internal(ockCtx, ockHMAC, keyNative, keySize);
  (*env)->ReleasePrimitiveArrayCritical(env, key, keyNative, 0);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions