Fossil SCM
Avoid NULL dereference when importing incremental Subversion dumps. This may not be the correct solution, but at least it's not outright crashing anymore.
Commit
2ade560ea02f20ff272ddb63ca80d5cc340377db
Parent
10faea6e0f3deeb…
1 file changed
+7
-5
+7
-5
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -987,15 +987,17 @@ | ||
| 987 | 987 | " WHERE trev<%d AND tbranch=%d", |
| 988 | 988 | gsvn.rev, branchId); |
| 989 | 989 | } |
| 990 | 990 | if( parentRid>0 ){ |
| 991 | 991 | pParentManifest = manifest_get(parentRid, CFTYPE_MANIFEST, 0); |
| 992 | - pParentFile = manifest_file_next(pParentManifest, 0); | |
| 993 | - parentBranch = db_int(0, "SELECT tbranch FROM xrevisions WHERE trid=%d", | |
| 994 | - parentRid); | |
| 995 | - if( parentBranch!=branchId && branchType!=SVN_TAG ){ | |
| 996 | - sameAsParent = 0; | |
| 992 | + if( pParentManifest ){ | |
| 993 | + pParentFile = manifest_file_next(pParentManifest, 0); | |
| 994 | + parentBranch = db_int(0, "SELECT tbranch FROM xrevisions WHERE trid=%d", | |
| 995 | + parentRid); | |
| 996 | + if( parentBranch!=branchId && branchType!=SVN_TAG ){ | |
| 997 | + sameAsParent = 0; | |
| 998 | + } | |
| 997 | 999 | } |
| 998 | 1000 | } |
| 999 | 1001 | if( mergeRid<MAX_INT_32 ){ |
| 1000 | 1002 | if( gsvn.zComment ){ |
| 1001 | 1003 | blob_appendf(&manifest, "C %F\n", gsvn.zComment); |
| 1002 | 1004 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -987,15 +987,17 @@ | |
| 987 | " WHERE trev<%d AND tbranch=%d", |
| 988 | gsvn.rev, branchId); |
| 989 | } |
| 990 | if( parentRid>0 ){ |
| 991 | pParentManifest = manifest_get(parentRid, CFTYPE_MANIFEST, 0); |
| 992 | pParentFile = manifest_file_next(pParentManifest, 0); |
| 993 | parentBranch = db_int(0, "SELECT tbranch FROM xrevisions WHERE trid=%d", |
| 994 | parentRid); |
| 995 | if( parentBranch!=branchId && branchType!=SVN_TAG ){ |
| 996 | sameAsParent = 0; |
| 997 | } |
| 998 | } |
| 999 | if( mergeRid<MAX_INT_32 ){ |
| 1000 | if( gsvn.zComment ){ |
| 1001 | blob_appendf(&manifest, "C %F\n", gsvn.zComment); |
| 1002 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -987,15 +987,17 @@ | |
| 987 | " WHERE trev<%d AND tbranch=%d", |
| 988 | gsvn.rev, branchId); |
| 989 | } |
| 990 | if( parentRid>0 ){ |
| 991 | pParentManifest = manifest_get(parentRid, CFTYPE_MANIFEST, 0); |
| 992 | if( pParentManifest ){ |
| 993 | pParentFile = manifest_file_next(pParentManifest, 0); |
| 994 | parentBranch = db_int(0, "SELECT tbranch FROM xrevisions WHERE trid=%d", |
| 995 | parentRid); |
| 996 | if( parentBranch!=branchId && branchType!=SVN_TAG ){ |
| 997 | sameAsParent = 0; |
| 998 | } |
| 999 | } |
| 1000 | } |
| 1001 | if( mergeRid<MAX_INT_32 ){ |
| 1002 | if( gsvn.zComment ){ |
| 1003 | blob_appendf(&manifest, "C %F\n", gsvn.zComment); |
| 1004 |