Fossil SCM

Fix an off-by-one error that can cause a segfault during sync.

drh 2007-08-09 11:55 trunk
Commit 6eca3132fe0bf285424b41c8cac0f3195a101825
1 file changed +1 -1
+1 -1
--- src/vfile.c
+++ src/vfile.c
@@ -39,11 +39,11 @@
3939
** If the UUID is not found and phantomize is 1, then attempt to
4040
** create a phantom record.
4141
*/
4242
int uuid_to_rid(const char *zUuid, int phantomize){
4343
int rid, sz;
44
- char z[UUID_SIZE];
44
+ char z[UUID_SIZE+1];
4545
4646
sz = strlen(zUuid);
4747
if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
4848
return 0;
4949
}
5050
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button