tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Delle Grazie <brett.dellegra...@gmail.com>
Subject Re: Apache2 mod_jk segfaults with OS X Mavericks
Date Mon, 28 Oct 2013 09:21:45 GMT
Please see interleaved. This is off list so you can object to my
interference :)

Sent from my mobile so please forgive any auto correct errors

Kind regards,
Brett
On 24 Oct 2013 22:55, "Christopher Schultz" <chris@christopherschultz.net>
wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> All,
>
> On 10/24/13, 4:33 PM, Christopher Schultz wrote:
> > All,
> >
> > On 10/24/13, 4:11 PM, Christopher Schultz wrote:
> >> Peter,
> >
> >> On 10/24/13, 12:25 PM, Peter Aarestad wrote:
> >>> Actually, here's the patch I just did, based on the comments in
> >>>  that bug report
> >
> >> Here is my preferred patch:
> >
> > Er, that's not going to work ;)
> >
> > I'm actively working on this, now, so it shouldn't be long. ;)
>
> Once I realized I was editing the wrong copy of the file, development
> on this went much more quickly ;)
>
> Index: native/common/jk_map.c
> ===================================================================
> - --- native/common/jk_map.c    (revision 1535519)
> +++ native/common/jk_map.c      (working copy)
> @@ -189,13 +189,15 @@
>      int int_res;
>      int multit = 1;
>
> - -    sprintf(buf, "%d", def);
> - -    rc = jk_map_get_string(m, name, buf);
> +    rc = jk_map_get_string(m, name, NULL);
>
> +    if(NULL == rc) {
> +        int_res = def;
> +    } else {
>      len = strlen(rc);
>      if (len) {
>          char *lastchar = &buf[0] + len - 1;
> - -        strcpy(buf, rc);
> +            strncpy(buf, rc, 100);

Rather than 100 shouldn't that be sizeof(buf) - 1
Or even min(sizeof(buf)-1, len) ? And then handle the null terminator
explicitly?

I can't see the whole file as I'm on a bus!

>          if ('m' == *lastchar || 'M' == *lastchar) {
>              *lastchar = '\0';
>              multit = 1024 * 1024;
> @@ -208,6 +210,7 @@
>      }
>      else
>          int_res = def;
> +    }
>
>      return int_res * multit;
>  }
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.14 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJSaYfyAAoJEBzwKT+lPKRYoGUP/1pMlAMnnzzawQ1oLoGUmuFL
> jFcVtrVr2R1cFNXof9bj/lVY69qOj7eJd4QRM61C8kQH85pQbX18O1vYg6ALxaT3
> Mlm1EIKOSluECbb3yCax+w+/BKXI1jlI9o57D1MYvjFlpXVKwex9Hsd6ERYelqFy
> ol1GUhb42zakw/CSFz2yAddqxFVWCQPFCAc2u4tCfEsmmUwOOOtyz/tZrkQNVRPd
> aNBSdpfXXlQxMqRi3GkbQq6HRBAduuu7WUrYdmSC3CCb1NC/YoTMCVhND1KAX/PD
> 0WWZL5SEaBNLOP4a4zp5DZ5XRh4pqEHOofBknaO3Y9ucp5kqAcJfdRQ+slunCvjf
> pOfXVAyAr24pFROIItQcAdtO45VG7lkLbxG66SuAnBdorp/kBjdFJwDVXR8yjjay
> ig4z1vWOdLCQ9mXzaHseWPjue3fZ92Q9dCDs5vdHAOiYcF/y9o1fjcGX7YIvY43C
> vM3mHi2+1W/mwrf+Dey92jHsrMpNqsgTnJmxw0k78Y6rZLBdzwFhsy22MYiGCcEy
> sJCWnHHtHuiboQoEBs78wgq/7TivX7xgyMATEYBYiUYHU24l/uY4yitbZndh9ukx
> iddr/0MTtXnj44JSnZSHqfct1/PGQVaQR0XucH4PRnFye8SUhgcjTOiP/Z0ZGGso
> eJKkBEcXlq7Pv36TW1qK
> =fSvA
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message