christf / snapcastc

C implementation of snapcast focussing on audio quality and ease of maintenance.
GNU General Public License v3.0
43 stars 6 forks source link

Memory issue in server as reported by valgrind #46

Closed christf closed 4 years ago

christf commented 4 years ago

handling socket event read: {"id":5,"jsonrpc":"2.0","method":"Server.GetStatus"} length: 54 offset 0 parsing line: {"id":5,"jsonrpc":"2.0","method":"Server.GetStatus"}

parsing line: {"id":5,"jsonrpc":"2.0","method":"Server.GetStatus"} length 54 ==30266== Invalid read of size 2 ==30266== at 0x1157C0: chunk_copy_meta (pcmchunk.c:110) ==30266== by 0x10DC6D: remove_old_audiodata_task (intercom_srv.c:56) ==30266== by 0x113CC9: taskqueue_run (taskqueue.c:132) ==30266== by 0x10CD46: loop (server.c:108) ==30266== by 0x10D840: main (server.c:251) ==30266== Address 0x5981199 is 0 bytes after a block of size 41 alloc'd ==30266== at 0x483577F: malloc (vg_replace_malloc.c:299) ==30266== by 0x10DAC8: snap_alloc (alloc.h:42) ==30266== by 0x10E11D: intercom_send_audio (intercom_srv.c:130) ==30266== by 0x10CF10: loop (server.c:120) ==30266== by 0x10D840: main (server.c:251) ==30266== ==30266== Invalid read of size 1 ==30266== at 0x1157D0: chunk_copy_meta (pcmchunk.c:111) ==30266== by 0x10DC6D: remove_old_audiodata_task (intercom_srv.c:56) ==30266== by 0x113CC9: taskqueue_run (taskqueue.c:132) ==30266== by 0x10CD46: loop (server.c:108) ==30266== by 0x10D840: main (server.c:251) ==30266== Address 0x598119b is 2 bytes after a block of size 41 alloc'd ==30266== at 0x483577F: malloc (vg_replace_malloc.c:299) ==30266== by 0x10DAC8: snap_alloc (alloc.h:42) ==30266== by 0x10E11D: intercom_send_audio (intercom_srv.c:130) ==30266== by 0x10CF10: loop (server.c:120) ==30266== by 0x10D840: main (server.c:251) ==30266==

christf commented 4 years ago

fix is in #49