forked from memcached/memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory corruption issue with bad item lengths
Partially fixed in 1.2.8, unfixed somewhere since, now fully fixed. Negative values allowed memory corruption, and high values also allowed corruption in swallow mode. Length is now guaranteed to be positive. Fixes issue 70.
- Loading branch information
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use Test::More tests => 4; | ||
use FindBin qw($Bin); | ||
use lib "$Bin/lib"; | ||
use MemcachedTest; | ||
|
||
my $server = new_memcached(); | ||
my $sock = $server->sock; | ||
|
||
print $sock "set issue70 0 0 0\r\n\r\n"; | ||
is (scalar <$sock>, "STORED\r\n", "stored issue70"); | ||
|
||
print $sock "set issue70 0 0 -1\r\n"; | ||
is (scalar <$sock>, "CLIENT_ERROR bad command line format\r\n"); | ||
|
||
print $sock "set issue70 0 0 4294967295\r\n"; | ||
is (scalar <$sock>, "CLIENT_ERROR bad command line format\r\n"); | ||
|
||
print $sock "set issue70 0 0 2147483647\r\nscoobyscoobydoo"; | ||
is (scalar <$sock>, "CLIENT_ERROR bad command line format\r\n"); |