Skip to content

CID 1508984: Dereference null return value #10224

Description

@maskit
 72EVP_PKEY *
 73async_load_privkey(ENGINE *e, const char *s_key_id, UI_METHOD *ui_method, void *callback_data)
 74{
 75  fprintf(stderr, "Loading key %s\n", s_key_id);
   	1. returned_null: fopen returns NULL (checked 24 out of 30 times).
   	2. var_assigned: Assigning: f = NULL return value from fopen.
 76  FILE *f       = fopen(s_key_id, "r");
 77  EVP_PKEY *key = PEM_read_PrivateKey(f, NULL, NULL, NULL);
   	
CID 1508984 (#1 of 1): Dereference null return value (NULL_RETURNS)
3. dereference: Dereferencing a pointer that might be NULL f when calling fclose.
 78  fclose(f);
 79  return key;
 80}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions