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

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Sep 18 10:58:57 UTC 2018


#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


More information about the tor-bugs mailing list