From: Andre Noll Date: Mon, 29 Jul 2013 22:44:37 +0000 (+0200) Subject: server/gcrypt: Fix sending the empty status items. X-Git-Tag: v0.5.0~11 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=b7fc2e183f824003556e8c2cbf9bfa40d611228b;hp=b7fc2e183f824003556e8c2cbf9bfa40d611228b server/gcrypt: Fix sending the empty status items. 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. ---