Fossil SCM
Fix an off-by-one error that can cause a segfault during sync.
Commit
6eca3132fe0bf285424b41c8cac0f3195a101825
Parent
9a9cd8173888804…
1 file changed
+1
-1
+1
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -39,11 +39,11 @@ | ||
| 39 | 39 | ** If the UUID is not found and phantomize is 1, then attempt to |
| 40 | 40 | ** create a phantom record. |
| 41 | 41 | */ |
| 42 | 42 | int uuid_to_rid(const char *zUuid, int phantomize){ |
| 43 | 43 | int rid, sz; |
| 44 | - char z[UUID_SIZE]; | |
| 44 | + char z[UUID_SIZE+1]; | |
| 45 | 45 | |
| 46 | 46 | sz = strlen(zUuid); |
| 47 | 47 | if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){ |
| 48 | 48 | return 0; |
| 49 | 49 | } |
| 50 | 50 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | ** If the UUID is not found and phantomize is 1, then attempt to |
| 40 | ** create a phantom record. |
| 41 | */ |
| 42 | int uuid_to_rid(const char *zUuid, int phantomize){ |
| 43 | int rid, sz; |
| 44 | char z[UUID_SIZE]; |
| 45 | |
| 46 | sz = strlen(zUuid); |
| 47 | if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){ |
| 48 | return 0; |
| 49 | } |
| 50 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | ** If the UUID is not found and phantomize is 1, then attempt to |
| 40 | ** create a phantom record. |
| 41 | */ |
| 42 | int uuid_to_rid(const char *zUuid, int phantomize){ |
| 43 | int rid, sz; |
| 44 | char z[UUID_SIZE+1]; |
| 45 | |
| 46 | sz = strlen(zUuid); |
| 47 | if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){ |
| 48 | return 0; |
| 49 | } |
| 50 |