cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PATH_MAX

From: James Housley <jim_at_thehousleys.net>
Date: Tue, 19 Jun 2007 06:08:37 -0400

On Jun 19, 2007, at 4:43 AM, Daniel Stenberg wrote:

> On Mon, 18 Jun 2007, James Housley wrote:
>
>> Here is what I have come up with. It passes all tests and looks
>> right to me, but I would like another set of eyes this close to
>> release.
>
> Great!
>
> Looks fine to me. The only nit might be that it doesn't check for
> malloc failures in the aprintf(), so if you run the torture tests
> on the SSH-related cases they may reveal something:

Actually it does:
@@ -394,12 +391,19 @@
          curl_free(home);
- infof(conn->data, "Using ssh public key file %s\n", sshc-
>rsa_pub);
- infof(conn->data, "Using ssh private key file %s\n", sshc-
>rsa);
+ if (sshc->rsa_pub) {
+ infof(conn->data, "Using ssh public key file %s\n", sshc-
>rsa_pub);
+ }
+ if (sshc->rsa) {
+ infof(conn->data, "Using ssh private key file %s\n", sshc-
>rsa);
+ }
- if (sshc->rsa_pub[0]) {
+ if (sshc->rsa_pub && sshc->rsa_pub) {
            state(conn, SSH_AUTH_PKEY);
          } else {
+ curl_free(sshc->rsa_pub);
+ curl_free(sshc->rsa);
+
            state(conn, SSH_AUTH_PASS_INIT);
          }

If either fail, then public key authentication is not used. Both are
freed and the state machine moves on to password authentication.

>
> $ cd tests
> $ ./runtests -t [num]

It reports error, but the information is of no use.

** MEMORY FAILURE
FREE ERROR: Memory freed twice: MEM ssh.c:233 free(0x2807a04)
FREE ERROR: Previously freed at: ssh.c:233
LIMIT ssh.c:221 malloc reached memlimit

Those are LIBSSH2_ALLOC_FUNC() and LIBSSH2_FREE_FUNC()

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
                      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
Do not meddle in the affairs of dragons, for you are crunchy and taste
     good with ketchup.
Received on 2007-06-19