Fossil SCM

Fix a NULL-pointer dereference in "branch new". Ticket [a4a9f45b67cbbcf26].

drh 2010-10-27 19:56 trunk
Commit ff79f97a072ee1c1630ba1c26e53cbdda99cb1ab
1 file changed +1 -1
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -92,11 +92,11 @@
9292
/* Copy all of the content from the parent into the branch */
9393
for(i=0; i<pParent->nFile; ++i){
9494
blob_appendf(&branch, "F %F", pParent->aFile[i].zName);
9595
if( pParent->aFile[i].zUuid ){
9696
blob_appendf(&branch, " %s", pParent->aFile[i].zUuid);
97
- if( pParent->aFile[i].zPerm[0] ){
97
+ if( pParent->aFile[i].zPerm && pParent->aFile[i].zPerm[0] ){
9898
blob_appendf(&branch, " %s", pParent->aFile[i].zPerm);
9999
}
100100
}
101101
blob_append(&branch, "\n", 1);
102102
}
103103
--- src/branch.c
+++ src/branch.c
@@ -92,11 +92,11 @@
92 /* Copy all of the content from the parent into the branch */
93 for(i=0; i<pParent->nFile; ++i){
94 blob_appendf(&branch, "F %F", pParent->aFile[i].zName);
95 if( pParent->aFile[i].zUuid ){
96 blob_appendf(&branch, " %s", pParent->aFile[i].zUuid);
97 if( pParent->aFile[i].zPerm[0] ){
98 blob_appendf(&branch, " %s", pParent->aFile[i].zPerm);
99 }
100 }
101 blob_append(&branch, "\n", 1);
102 }
103
--- src/branch.c
+++ src/branch.c
@@ -92,11 +92,11 @@
92 /* Copy all of the content from the parent into the branch */
93 for(i=0; i<pParent->nFile; ++i){
94 blob_appendf(&branch, "F %F", pParent->aFile[i].zName);
95 if( pParent->aFile[i].zUuid ){
96 blob_appendf(&branch, " %s", pParent->aFile[i].zUuid);
97 if( pParent->aFile[i].zPerm && pParent->aFile[i].zPerm[0] ){
98 blob_appendf(&branch, " %s", pParent->aFile[i].zPerm);
99 }
100 }
101 blob_append(&branch, "\n", 1);
102 }
103

Keyboard Shortcuts

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