commit 8484ac15905bfff3892d9a7dcb3475ba018bb8e4
parent 8b34827a0692d8ecd4d176fef4c2af79a47a69b4
Author: sin <sin@2f30.org>
Date: Sun, 3 Mar 2013 21:49:12 +0000
mem: Don't apply empty rdiffs
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/mem.c b/mem.c
@@ -296,6 +296,9 @@ apply_diff(struct mem_region *dst,
if (!dst || !rdiff)
return NULL;
+ if (!rdiff->nmrdiffs)
+ return NULL;
+
for (i = 0; i < rdiff->nmrdiffs; i++) {
mdiff = &rdiff->mrdiffs[i];
mb = &dst->mblks[mdiff->index];