Package: speech-dispatcher
Version: 0.7-5.1
Severity: important
Tags: patch

Under some conditions, the speech-dispatcher daemon would crash.
valgrind made me realize it's because of a not-so-big-enough allocation,
see attached patch: it does sometimes happen that client_socket is not
only bigger than SpeechdStatus.num_fds-1, but it's also even bigger than
2*SpeechdStatus.num_fds-1, so that doubling the size of the array is not
enough. The attached patch fixes it quite trivially by continuing
doubling the size of the array until it's big enough.

Samuel

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.36 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages speech-dispatcher depends on:
ii  adduser                3.112             add and remove users and groups
ii  dpkg                   1.15.8.5          Debian package management system
ii  install-info           4.13a.dfsg.1-5    Manage installed documentation in 
ii  libasound2             1.0.21a-1+youpi.1 shared library for ALSA applicatio
ii  libaudio2              1.9.2-3           Network Audio System - shared libr
ii  libc6                  2.11.2-6          Embedded GNU C Library: Shared lib
ii  libdotconf1.0          1.0.13-3          Configuration file parser library 
ii  libespeak1             1.43.03-2         A multi-lingual software speech sy
ii  libflite1              1.4-release-2     a small run-time speech synthesis 
ii  libglib2.0-0           2.24.2-1          The GLib library of C routines
ii  libpulse0              0.9.21-3+b1       PulseAudio client libraries
ii  libspeechd2            0.7-5.1           Speech Dispatcher: Shared librarie
ii  lsb-base               3.2-23.1          Linux Standard Base 3.2 init scrip

Versions of packages speech-dispatcher recommends:
pn  pulseaudio                    <none>     (no description available)

Versions of packages speech-dispatcher suggests:
pn  speech-dispatcher-doc-cs      <none>     (no description available)
pn  speech-dispatcher-festival    <none>     (no description available)

-- Configuration Files:
/etc/speech-dispatcher/speechd.conf changed [not included]

-- no debconf information

-- 
Samuel Thibault <samuel.thiba...@fnac.net>
void packerFlushTheToiletFirstThingInTheMorning( void* arg )
 -+- chromium's source code -+-
--- ./src/server/speechd.c.original     2010-10-24 02:53:38.000000000 +0200
+++ ./src/server/speechd.c      2010-10-24 02:53:39.000000000 +0200
@@ -286,7 +286,7 @@
     MSG(4,"Adding client on fd %d", client_socket);
 
     /* Check if there is space for server status data; allocate it */
-    if(client_socket >= SpeechdStatus.num_fds-1){
+    while(client_socket >= SpeechdStatus.num_fds-1){
        SpeechdSocket = (TSpeechdSock*) realloc(SpeechdSocket,
                                                SpeechdStatus.num_fds*2*
                                                sizeof(TSpeechdSock)); 

Reply via email to