Fix off-by-one error in the BlueSky simple storage backend.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 21 Jan 2011 00:34:59 +0000 (16:34 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 21 Jan 2011 00:34:59 +0000 (16:34 -0800)
One extra byte of data was being included into the data returned, leading
to data corruption.  Fix this.

bluesky/store-simple.c

index ef68e11..25eef53 100644 (file)
@@ -143,7 +143,7 @@ static void simplestore_task(gpointer a, gpointer b)
 
         char *data = g_malloc(result);
         if (strchr(result_buf, '\n') != NULL) {
-            int header_size = strchr(result_buf, '\n') - result_buf;
+            int header_size = strchr(result_buf, '\n') - result_buf + 1;
             int data_bytes = bytes - header_size;
             if (data_bytes > result)
                 data_bytes = result;