Bug#385751: Polipo segfaults on long URLs due to incorrect vararg usage

2006-09-11 Thread Juliusz Chroboczek
 If you understand va_* -- could you please help me with fixing the
 second definition of vsprintf_a, which has the same issue, but which I
 don't know how to fix?  It doesn't bite GNU/Linux systems, where the
 first definition is used.

 If you need to repeatedly use a given va_list, use va_copy(). See its
 manpage for the correct usage.

As far as I can tell, it won't work in that case.  I'm not using
va_start in that function.

Juliusz


pgpPyO5fPsvOv.pgp
Description: PGP signature


Bug#385751: Polipo segfaults on long URLs due to incorrect vararg usage

2006-09-11 Thread Guus Sliepen
On Mon, Sep 11, 2006 at 09:52:54PM +0200, Juliusz Chroboczek wrote:

  If you understand va_* -- could you please help me with fixing the
  second definition of vsprintf_a, which has the same issue, but which I
  don't know how to fix?  It doesn't bite GNU/Linux systems, where the
  first definition is used.
 
  If you need to repeatedly use a given va_list, use va_copy(). See its
  manpage for the correct usage.
 
 As far as I can tell, it won't work in that case.  I'm not using
 va_start in that function.

You don't need to. You do need to do a va_end() after a va_copy()
though. So it's like this:

void a(char *fmt, ...) {
va_list ap;
va_start(ap, foo);
b(fmt, ap);
va_end();
}

void b(char *fmt, va_list ap) {
va_list ap2;
va_copy(ap2, ap);
vprintf(fmt, ap);
vprintf(fmt, ap2);
va_end(ap2);
}

-- 
Met vriendelijke groet / with kind regards,
  Guus Sliepen [EMAIL PROTECTED]


signature.asc
Description: Digital signature


Bug#385751: Polipo segfaults on long URLs due to incorrect vararg usage

2006-09-05 Thread Juliusz Chroboczek
 In atom.c around line 182, the va_list args can be used twice between
 va_start and va_end.

I beat you to it by a few days ;-) A pity, your report would have
saved me some debugging.

If you understand va_* -- could you please help me with fixing the
second definition of vsprintf_a, which has the same issue, but which I
don't know how to fix?  It doesn't bite GNU/Linux systems, where the
first definition is used.

Thanks,

Juliusz


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#385751: Polipo segfaults on long URLs due to incorrect vararg usage

2006-09-05 Thread Guus Sliepen
On Tue, Sep 05, 2006 at 10:25:39AM +0200, Juliusz Chroboczek wrote:

  In atom.c around line 182, the va_list args can be used twice between
  va_start and va_end.
 
 I beat you to it by a few days ;-) A pity, your report would have
 saved me some debugging.
 
 If you understand va_* -- could you please help me with fixing the
 second definition of vsprintf_a, which has the same issue, but which I
 don't know how to fix?  It doesn't bite GNU/Linux systems, where the
 first definition is used.

If you need to repeatedly use a given va_list, use va_copy(). See its
manpage for the correct usage.

-- 
Met vriendelijke groet / with kind regards,
  Guus Sliepen [EMAIL PROTECTED]


signature.asc
Description: Digital signature