[BRLTTY] Fix exception print segfault on solaris

Samuel Thibault samuel.thibault at ens-lyon.org
Wed Jul 8 20:44:25 EDT 2009


Hello,

This patch fixes a probable segfault on solaris when printing
exceptions: its libc doesn't cope itself with NULLs.

Samuel
-------------- next part --------------
Index: Programs/brlapi_client.c
===================================================================
--- Programs/brlapi_client.c	(r?vision 4682)
+++ Programs/brlapi_client.c	(copie de travail)
@@ -1830,7 +1830,7 @@
     return errmsg;
   }
   else if (error->brlerrno==BRLAPI_ERROR_LIBCERR) {
-    snprintf(errmsg,sizeof(errmsg),"%s: %s", error->errfun, strerror(error->libcerrno));
+    snprintf(errmsg,sizeof(errmsg),"%s: %s", error->errfun?error->errfun:"(null)", strerror(error->libcerrno));
     return errmsg;
   } else
     return brlapi_errlist[error->brlerrno];


More information about the BRLTTY mailing list