Bug#534641: mendex bug

2013-09-08 Thread TSUCHIMURA Nobuyuki
Hi Norbert, hi all, > +#define TAIL_LEN(x) ((x)+strlen(x)), (BUFFERLEN-strlen(x)) OK, I recognize 'BUFFERLEN-strlen(x)' is always plus. Even when buffer is full, strlen(x) become BUFFERLEN-1, because buffer includes '\0'. Sorry. Please forget my previous mail. I'll attach my test source.

Bug#534641: mendex bug

2013-09-08 Thread TSUCHIMURA Nobuyuki
Hi Norbert, hi all, -#define TAIL(x) (x+strlen(x)) +#define TAIL(x) ((x)+strlen(x)) It was my fault. Thank you for correcting. +#define TAIL_LEN(x) ((x)+strlen(x)), (BUFFERLEN-strlen(x)) Nice idea. I'm not sure but I'm wandering if snprintf() can handle negative (minus) length or not.

Bug#534641: mendex bug

2013-09-07 Thread Norbert Preining
Hi Karl, hi all, On Sa, 07 Sep 2013, Karl Berry wrote: > #define TAIL(x) (x+strlen(x)) Done, fixed patch attached: mendex-bugfix > In general, shouldn't snprintf be used to avoid the whole potential of > buffer overrun? Done that for fwrite.c, but there are other cases in the source. Patch

Bug#534641: mendex bug

2013-09-07 Thread Norbert Preining
On Sa, 07 Sep 2013, Karl Berry wrote: > As you know, it was part of the general Japanese-TeX import into TL, so > I suppose you and Akira are :), with the rest of us chipping in as > necessary. > > Please apply whatever patch you see fit. Ok, will do that. > #define TAIL(x) (x+strlen(x)) >

Bug#534641: mendex bug

2013-09-07 Thread Karl Berry
I am not sure who is currently maintaining mendex, As you know, it was part of the general Japanese-TeX import into TL, so I suppose you and Akira are :), with the rest of us chipping in as necessary. Please apply whatever patch you see fit. #define TAIL(x) (x+strlen(x)) The first x o

Bug#534641: mendex bug

2013-09-07 Thread Norbert Preining
Dear all, I hope there is still someone listening. Since quite some time there is a bug in mendex. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534641 Easy to reproduce: With the following idx file: \indexentry{foo|(}{1} \indexentry{foo|mac}{1} \indexentry{foo|)}