Fossil SCM
Fix a NULL-pointer dereference in "branch new". Ticket [a4a9f45b67cbbcf26].
Commit
ff79f97a072ee1c1630ba1c26e53cbdda99cb1ab
Parent
e21ca81e1a76f98…
1 file changed
+1
-1
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -92,11 +92,11 @@ | ||
| 92 | 92 | /* Copy all of the content from the parent into the branch */ |
| 93 | 93 | for(i=0; i<pParent->nFile; ++i){ |
| 94 | 94 | blob_appendf(&branch, "F %F", pParent->aFile[i].zName); |
| 95 | 95 | if( pParent->aFile[i].zUuid ){ |
| 96 | 96 | 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] ){ | |
| 98 | 98 | blob_appendf(&branch, " %s", pParent->aFile[i].zPerm); |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | blob_append(&branch, "\n", 1); |
| 102 | 102 | } |
| 103 | 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[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 |