Fossil SCM

Fix an assertion fault: detect when content_get() is called with an invalid artifact id and return 0.

drh 2008-03-14 12:43 trunk
Commit 4e2bd38577b2c83b7bc502d023a397172f2a1a66
1 file changed +1
--- src/content.c
+++ src/content.c
@@ -165,10 +165,11 @@
165165
int i;
166166
static Bag inProcess;
167167
168168
assert( g.repositoryOpen );
169169
blob_zero(pBlob);
170
+ if( rid==0 ) return 0;
170171
171172
/* Early out if we know the content is not available */
172173
if( bag_find(&contentCache.missing, rid) ){
173174
CONTENT_TRACE(("%*smiss from cache: %d\n",
174175
bag_count(&inProcess), "", rid))
175176
--- src/content.c
+++ src/content.c
@@ -165,10 +165,11 @@
165 int i;
166 static Bag inProcess;
167
168 assert( g.repositoryOpen );
169 blob_zero(pBlob);
 
170
171 /* Early out if we know the content is not available */
172 if( bag_find(&contentCache.missing, rid) ){
173 CONTENT_TRACE(("%*smiss from cache: %d\n",
174 bag_count(&inProcess), "", rid))
175
--- src/content.c
+++ src/content.c
@@ -165,10 +165,11 @@
165 int i;
166 static Bag inProcess;
167
168 assert( g.repositoryOpen );
169 blob_zero(pBlob);
170 if( rid==0 ) return 0;
171
172 /* Early out if we know the content is not available */
173 if( bag_find(&contentCache.missing, rid) ){
174 CONTENT_TRACE(("%*smiss from cache: %d\n",
175 bag_count(&inProcess), "", rid))
176

Keyboard Shortcuts

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