Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #27764
Closed (moved) (moved)
Open
Issue created Sep 18, 2018 by George Kadianakis@asn

crypto_rsa.c: CID 1439488: Resource leaks

Coverity report from 18th Sept:

/src/lib/crypt_ops/crypto_rsa.c: 558 in crypto_pk_read_private_key_from_filename()
552     {
553       struct stat st;
554       char *buf = read_file_to_str(keyfile, 0, &st);
555       if (!buf)
556         return -1;
557       if (st.st_size > MAX_PRIVKEY_FILE_LEN)
>>>     CID 1439488:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "buf" going out of scope leaks the storage it points to.
558         return -1;
559     
560       int rv = crypto_pk_read_private_key_from_string(env, buf,
561                                                       (ssize_t)st.st_size);
562       memwipe(buf, 0, (size_t)st.st_size);
563       tor_free(buf);
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking