[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#291438: tetex-bin: dvipdfm segfaults when used with hyperref and hypertex



Prabhu Ramachandran <prabhu_r@users.sf.net> 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.
[...]
> -  static char date_string[24];
> +  static char date_string[32];

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

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

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

Regards, Frank
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer




Reply to: