]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
server/gcrypt: Fix sending the empty status items.
authorAndre Noll <maan@systemlinux.org>
Mon, 29 Jul 2013 22:44:37 +0000 (00:44 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 31 Jul 2013 21:17:12 +0000 (23:17 +0200)
When para_server enters the "stopped" state, it needs to inform all
clients which are executing the stat command that no audio file is
currently available.

To this aim the stat command handler calls empty_status_items(), which
creates a buffer containing empty values for most status items. This
function tries to be smart by computing the buffer only once. It
saves a reference in a static variable so that on subsequent calls
it can simply return the same buffer.

This works fine when para_server is compiled against the openssl
crypto library. However, it fails when libgcrypt is used because with
libgcrypt the send buffer is encrypted in-place. Hence on subsequent
calls the already encrypted buffer will be encrypted again, resulting
in garbage being sent to the client.

This patch avoids this bug by using a fresh buffer each time the
empty status items are sent.


No differences found