[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [libunwind] [patch] Handle strings that aren't NULL terminated
From: |
Ed Connell |
Subject: |
RE: [libunwind] [patch] Handle strings that aren't NULL terminated |
Date: |
Mon, 21 Jun 2004 13:57:52 -0400 |
Your patch works for me, too. It is better than the one I sent in.
Thanks
Ed
> -----Original Message-----
> From: Mark Young [mailto:address@hidden
> Sent: Saturday, June 19, 2004 1:57 PM
> To: address@hidden
> Cc: Ed Connell; address@hidden
> Subject: Re: [libunwind] [patch] Handle strings that aren't
> NULL terminated
>
>
> Sorry, yes, the patch did fix the problem.
> --Mark
>
> David Mosberger wrote:
>
> >>>>> On Fri, 18 Jun 2004 14:23:15 -0400, "Ed Connell"
> <mailto:address@hidden> <address@hidden> said:
>
> Ed> Intel's icc produces strings that aren't NULL terminated which
> Ed> causes a crash in libunwind. Here's a fix.
>
> I don't see how this could happen. Do you have a concrete example?
>
> Note: there was a related/similar bug reported by Mark Young which
> should be fixed by the attached problem (though I never seem to have
> gotten confirmation of that, now that you remind me of it).
>
> Does the attached patch fix the problem for you?
>
> Thanks,
>
> --david
>
> ===== src/os-linux.h 1.5 vs edited =====
> --- 1.5/src/os-linux.h Wed Apr 21 00:24:34 2004
> +++ edited/src/os-linux.h Wed Jun 9 16:01:47 2004
> @@ -139,9 +139,12 @@
>
> while (1)
> {
> - digit = *cp++;
> + digit = *cp;
> if ((digit - '0') <= 9)
> - digit -= '0';
> + {
> + digit -= '0';
> + ++cp;
> + }
> else
> break;
> val = (10 * val) + digit;
> @@ -159,7 +162,11 @@
> if (!cp)
> return NULL;
>
> - *valp = *cp++;
> + *valp = *cp;
> +
> + /* don't step over NUL terminator */
> + if (*cp)
> + ++cp;
> return cp;
> }
>
> _______________________________________________
> libunwind mailing list
> address@hidden <mailto:address@hidden>
> http://www.hpl.hp.com/hosted/linux/mail-archives/libunwind/
> <http://www.hpl.hp.com/hosted/linux/mail-> archives/libunwind/>
>
>
>