[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #27764 [Core Tor/Tor]: crypto_rsa.c: CID 1439488: Resource leaks



#27764: crypto_rsa.c: CID 1439488:  Resource leaks
------------------------------+---------------------------------
     Reporter:  asn           |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.5.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  tor-crypto coverity
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+---------------------------------
 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);
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27764>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs