Merge lp://staging/~trond-norbye/libmemcached/bug_446607 into lp://staging/~tangent-org/libmemcached/trunk

Proposed by Trond Norbye
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~trond-norbye/libmemcached/bug_446607
Merge into: lp://staging/~tangent-org/libmemcached/trunk
Diff against target: 21 lines
1 file modified
tests/function.c (+2/-2)
To merge this branch: bzr merge lp://staging/~trond-norbye/libmemcached/bug_446607
Reviewer Review Type Date Requested Status
Libmemcached-developers Pending
Review via email: mp+13094@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Trond Norbye (trond-norbye) wrote :

Two of the regression tests didn't initialize the data it stored for a key, causing an uninitialized memory read.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/function.c'
2--- tests/function.c 2009-10-08 20:25:24 +0000
3+++ tests/function.c 2009-10-08 21:25:18 +0000
4@@ -4566,7 +4566,7 @@
5 assert(ret == MEMCACHED_NOTSTORED);
6
7 size_t size= 2048 * 1024;
8- void *data= malloc(size);
9+ void *data= calloc(1, size);
10 assert(data != NULL);
11 ret= memcached_set(memc, key, keylen, data, size, 0, 0);
12 assert(ret == MEMCACHED_E2BIG);
13@@ -4616,7 +4616,7 @@
14 {
15 /* The first iteration should give me a 100% cache miss. verify that*/
16 assert(counter == 0);
17- char blob[1024];
18+ char blob[1024]= { 0 };
19 for (int x= 0; x < (int)max_keys; ++x)
20 {
21 rc= memcached_add(memc, keys[x], key_length[x],

Subscribers

People subscribed via source and target branches

to all changes: