Re: deutex 4.4.902 SEGVs if $CWD is read-only
- From: Andre Majorel <amajorel@xxxxxxxxx>
- To: Jon Dowland <jon@xxxxxxxxxxx>
- Date: Wed, 15 Mar 2006 14:12:45 +0100
On 2006-03-14 23:20 +0000, Jon Dowland wrote:
> Deutex 4.4.902 segfaults if the current-working-directory is
> mounted read-only. This appears to be related to writing out
> the logfile, but I have done no further investigation beyond
> what you see in deutex-segv.txt.
Fixed, thanks. I had forgotten to add (|| logfp == &nolog) to the
(logfp == NULL) tests.
--
André Majorel <amajorel@xxxxxxxxx>
http://www.teaser.fr/~amajorel/
--- src/log.c~ 2005-08-30 18:06:20.000000000 +0200
+++ src/log.c 2006-03-15 13:58:44.000000000 +0100
@@ -65,7 +65,7 @@
*/
void lputc (char c)
{
- if (logfp == NULL)
+ if (logfp == NULL || logfp == &nolog)
return;
fputc (c, logfp);
fflush (logfp); /* We don't want a segfault to truncate the log */
@@ -77,7 +77,7 @@
*/
void lputs (const char *str)
{
- if (logfp == NULL)
+ if (logfp == NULL || logfp == &nolog)
return;
fputs (str, logfp);
fflush (logfp); /* We don't want a segfault to truncate the log */
@@ -91,7 +91,7 @@
{
va_list list;
- if (logfp == NULL)
+ if (logfp == NULL || logfp == &nolog)
return;
va_start (list, fmt);
vlprintf (fmt, list);
@@ -104,7 +104,7 @@
*/
void vlprintf (const char *fmt, va_list list)
{
- if (logfp == NULL)
+ if (logfp == NULL || logfp == &nolog)
return;
vfprintf (logfp, fmt, list);
fflush (logfp); /* We don't want a segfault to truncate the log */
Other related posts: