Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix syncd crashing due to invalid length being used for string printing
PR #801 added some code to convert binary strings to be printable strings. However, one code path used the raw value of `len` without sanity checking as the length of the string, when the `length()` function should have been used instead. Sample syncd backtrace: ``` (gdb) print *this $22 = {temp = 0x55feeaced250 "*3\r\n$6\r\nSCRIPT\r\n$4\r\nLOAD\r\n$863\r\nlocal keys = redis.call('KEYS', KEYS[1])\nlocal n = table.getn(keys)\n\nfor i = 1, n do\n if KEYS[2] == \"\" and KEYS[3] == \"1\" then\n redis.call('DEL', keys[i]) \n e"..., len = -355539936} ``` Fix this by using the `length()` function. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
- Loading branch information