solomonHou / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

a command input bug of redis-cli #636

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, i am a newbie of redis. 
I use redis for learning NoSQL, and i think it is a great NoSQL product.

Today i encountered a tiny bug of redis-cli, as shown below.

redis 127.0.0.1:6379> 1
Segmentation fault

or,

redis 127.0.0.1:6379> 1BGSAVE
Segmentation fault

I investigated the source code, and known its came from repl() or 
cliSendCommand() function. I think it is a tiny bug, so I tried to fix the code 
as below. But i am not familiar with the whole source , i don't know if it will 
affect the other codes. And i don't know how to write a test case too, so send 
you this message. I think you can fix this tiny bug easily.
The result of 'make test' is " \o/ All tests passed without errors! ".
thanks for the great production and sorry for my poor English.

The git diff code for reference only:

https://github.com/leopoldh/redis/commit/8d4f4a3a54937d511fbce24f23ef741cb8de117
8#diff-0

just check { if ( 0 != (argc - skipargs)) } before excute { cliSendCommand() }.

Original issue reported on code.google.com by hanl...@gmail.com on 18 Aug 2011 at 1:45

GoogleCodeExporter commented 8 years ago
Issue 638 has been merged into this issue.

Original comment by pcnoordh...@gmail.com on 18 Aug 2011 at 6:41