[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] check error_stream in svn_cmdline_init

From: Olaf Hering <olh_at_suse.de>
Date: Wed, 23 Jan 2008 15:51:20 +0100

error_stream can be null.
Its already checked in other places in that function.
fixes kdesvn crashes.

https://bugzilla.novell.com/show_bug.cgi?id=343706

---
 subversion/libsvn_subr/cmdline.c |    2 ++
 1 file changed, 2 insertions(+)
--- a/subversion/libsvn_subr/cmdline.c
+++ b/subversion/libsvn_subr/cmdline.c
@@ -82,6 +82,7 @@ svn_cmdline_init(const char *progname, F
 #pragma convert(1208)
 #endif
       {
+  if (error_stream)
         fprintf(error_stream, "%s: error: cannot open '/dev/null'\n",
                 progname);
         return EXIT_FAILURE;
@@ -92,6 +93,7 @@ svn_cmdline_init(const char *progname, F
   /* Ignore any errors encountered while attempting to change stream
      buffering, as the streams should retain their default buffering
      modes. */
+  if (error_stream)
   setvbuf(error_stream, NULL, _IONBF, 0);
 #ifndef WIN32
   setvbuf(stdout, NULL, _IOLBF, 0);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-23 16:11:49 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.