>>>>> "FK" == Frank Küster <[EMAIL PROTECTED]> writes:

    FK> Prabhu Ramachandran <[EMAIL PROTECTED]> wrote:
    >> OK, I've found the bug.  Basically, the asn_date function in
    >> texk/dvipdfm/pdfdoc.c was writing to a string but did not
    >> allocate enough memory for the string before writing to it.
    >> Attached is a trivial patch for the file texk/dvipdfm/pdfdoc.c.
    FK> [...]
    >> - static char date_string[24];
    >> + static char date_string[32];

    FK> First of all, I must admit that I don't have much experience
    FK> with C. But still I have some critical remarks to this:

    FK> - We couldn't reproduce the bug here, and it is in a function
    FK>   that works on time data. Could it be that it is your
    FK>   (Prabhu's) timezone or locale setting that is necessary to
    FK>   reproduce the segfault?

I guess so, I provided some data from gdb in my reply to your email.
I'm at GMT+0530 hours.

    FK> - Wouldn't it be better to find some clever way do dynamically
    FK>   allocate just as much memory for the date_string array as is
    FK>   needed? Especially when it is about timezone or locale, I
    FK>   suspect that sooner or later there will be one where even
    FK>   the 32 chars won't be sufficient.

Not sure about that.  I don't deal with time in C so am not sure what
the best approach is.  However, I don't think timezones are going to
change in our time scales. :) So I think coming up with a fix to
handle all timezones should work fine for the future.

I guess Mark will know better.

cheers,
prabhu

Reply via email to