My changes are working as designed, however, it crashes out if you enter a tube name above 12 characters.
If this is a new tube then create a new Announce tube using -A NAME … * BiGMiCR0/beanstalkd@df6f115 * GitHub
Have been trying to write unit tests for this with no success as well as fix the problem?
Big thanks in advance if anyone has any ideas.
Code:
==15169== Command: ./beanstalkd -A testtubename
==15169==
==15169== Invalid write of size 1
==15169== at 0x4C3275B: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15169== by 0x40962E: dispatch_cmd (prot.c:1550)
==15169== by 0x409D65: do_cmd (prot.c:1678)
==15169== by 0x409EFF: conn_data (prot.c:1718)
==15169== by 0x40A46E: h_conn (prot.c:1860)
==15169== by 0x40A520: prothandle (prot.c:1872)
==15169== by 0x40BC98: srvserve (serv.c:56)
==15169== by 0x40DCE1: main (main.c:91)
==15169== Address 0x52090aa is 0 bytes after a block of size 186 alloc'd
==15169== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15169== by 0x4043A1: allocate_job (job.c:97)
==15169== by 0x40444B: make_job_with_id (job.c:113)
==15169== by 0x409591: dispatch_cmd (prot.c:1549)
==15169== by 0x409D65: do_cmd (prot.c:1678)
==15169== by 0x409EFF: conn_data (prot.c:1718)
==15169== by 0x40A46E: h_conn (prot.c:1860)
==15169== by 0x40A520: prothandle (prot.c:1872)
==15169== by 0x40BC98: srvserve (serv.c:56)
==15169== by 0x40DCE1: main (main.c:91)