diff

Diff code posted
created at 15 Oct 16:59

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/Source/CBLDatabase+Attachments.m b/Source/CBLDatabase+Attachments.m
index 618168e..0480fbd 100644
--- a/Source/CBLDatabase+Attachments.m
+++ b/Source/CBLDatabase+Attachments.m
@@ -521,12 +521,9 @@ static bool digestToBlobKey(NSString* digest, CBLBlobKey* key) {
                 return nil;
             }
             id revPosObj = attachInfo[@"revpos"];
-            if (revPosObj) {
-                int revPos = [$castIf(NSNumber, revPosObj) intValue];
-                if (revPos <= 0) {
-                    *outStatus = kCBLStatusBadAttachment;
-                    return nil;
-                }
+            if (!revPosObj) { // allow any (even bogus) attachInfo[@"revpos"]
+                *outStatus = kCBLStatusBadAttachment;
+                return nil;
             }
             continue;
         }
850 Bytes in 5 ms with coderay