Package: motion
Version: 3.2.11-1.1
Severity: important
Tags: patch

Hi,

motion segfaults in motion_log() when it calls strerror_r(); apparently
nowadays the default strerror_r() is the POSIX version, so coding for the
GNU version fails.

The attached patch fixes this.

Regards,

Stephen

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (200, 'unstable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages motion depends on:
ii  adduser                3.110             add and remove users and groups
ii  debconf [debconf-2.0]  1.5.26            Debian configuration management sy
ii  libavcodec52           3:0.svn20090303-1 ffmpeg codec library
ii  libavformat52          3:0.svn20090303-1 ffmpeg file format library
ii  libavutil49            3:0.svn20090303-1 ffmpeg utility library
ii  libc6                  2.9-4             GNU C Library: Shared libraries
ii  libjpeg62              6b-14             The Independent JPEG Group's JPEG 
ii  libmysqlclient15off    5.0.51a-24        MySQL database client library
ii  libpq5                 8.3.7-1           PostgreSQL C client library

Versions of packages motion recommends:
ii  ffmpeg                 3:0.svn20090303-1 multimedia player, server and enco

Versions of packages motion suggests:
ii  mysql-client-5.0 [mysql-clien 5.0.51a-24 MySQL database client binaries
pn  postgresql-client             <none>     (no description available)

-- debconf information:
  motion/moved_conf_dir:
diff -u motion-3.2.11.broken/motion.c motion-3.2.11/motion.c
--- motion-3.2.11.broken/motion.c	2008-09-22 01:20:58.000000000 +0200
+++ motion-3.2.11/motion.c	2009-04-13 17:09:40.000000000 +0200
@@ -2738,9 +2738,6 @@
 {
     int errno_save, n;
     char buf[1024];
-#if (!defined(BSD))
-    char msg_buf[100];
-#endif
     va_list ap;
     int threadnr;
 
@@ -2767,16 +2764,7 @@
     if (errno_flag) {
         strcat(buf, ": ");
         n += 2;
-        /*
-         * this is bad - apparently gcc/libc wants to use the non-standard GNU
-         * version of strerror_r, which doesn't actually put the message into
-         * my buffer :-(.  I have put in a 'hack' to get around this.
-         */
-#if (defined(BSD))
         strerror_r(errno_save, buf + n, sizeof(buf) - n);    /* 2 for the ': ' */
-#else
-        strcat(buf, strerror_r(errno_save, msg_buf, sizeof(msg_buf)));
-#endif
     }
     /* If 'level' is not negative, send the message to the syslog */
     if (level >= 0)

Reply via email to