Fossil SCM

Fix segmentation fault in historical_version_of_file() when file has no permissions in manifest.

dmitry 2011-02-07 17:50 UTC symlinks
Commit 8e4e30fb035f9dc9054a555ce7f4e2a17e44087f
1 file changed +1 -1
+1 -1
--- src/update.c
+++ src/update.c
@@ -499,11 +499,11 @@
499499
manifest_file_rewind(pManifest);
500500
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
501501
if( fossil_strcmp(pFile->zName, file)==0 ){
502502
rid = uuid_to_rid(pFile->zUuid, 0);
503503
manifest_destroy(pManifest);
504
- if( isLink!=NULL ){
504
+ if( isLink!=NULL && pFile->zPerm != 0){
505505
*isLink = strstr(pFile->zPerm, "l") ? 1 : 0;
506506
}
507507
return content_get(rid, content);
508508
}
509509
}
510510
--- src/update.c
+++ src/update.c
@@ -499,11 +499,11 @@
499 manifest_file_rewind(pManifest);
500 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
501 if( fossil_strcmp(pFile->zName, file)==0 ){
502 rid = uuid_to_rid(pFile->zUuid, 0);
503 manifest_destroy(pManifest);
504 if( isLink!=NULL ){
505 *isLink = strstr(pFile->zPerm, "l") ? 1 : 0;
506 }
507 return content_get(rid, content);
508 }
509 }
510
--- src/update.c
+++ src/update.c
@@ -499,11 +499,11 @@
499 manifest_file_rewind(pManifest);
500 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
501 if( fossil_strcmp(pFile->zName, file)==0 ){
502 rid = uuid_to_rid(pFile->zUuid, 0);
503 manifest_destroy(pManifest);
504 if( isLink!=NULL && pFile->zPerm != 0){
505 *isLink = strstr(pFile->zPerm, "l") ? 1 : 0;
506 }
507 return content_get(rid, content);
508 }
509 }
510

Keyboard Shortcuts

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