Fossil SCM

Fix a NULL-pointer dereference bug in the graph generator.

drh 2015-01-27 01:39 trunk
Commit 03250bc6490de95f4e271533ae57b74d3ee4bd85
1 file changed +1 -1
+1 -1
--- src/graph.c
+++ src/graph.c
@@ -391,11 +391,11 @@
391391
pParent = hashFind(p, pRow->aParent[0]);
392392
if( pParent==0 ) continue; /* Parent off-screen */
393393
if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */
394394
for(i=1; i<pRow->nParent; i++){
395395
pParent = hashFind(p, pRow->aParent[i]);
396
- if( pParent->zBranch==pRow->zBranch ){
396
+ if( pParent && pParent->zBranch==pRow->zBranch ){
397397
int t = pRow->aParent[0];
398398
pRow->aParent[0] = pRow->aParent[i];
399399
pRow->aParent[i] = t;
400400
break;
401401
}
402402
--- src/graph.c
+++ src/graph.c
@@ -391,11 +391,11 @@
391 pParent = hashFind(p, pRow->aParent[0]);
392 if( pParent==0 ) continue; /* Parent off-screen */
393 if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */
394 for(i=1; i<pRow->nParent; i++){
395 pParent = hashFind(p, pRow->aParent[i]);
396 if( pParent->zBranch==pRow->zBranch ){
397 int t = pRow->aParent[0];
398 pRow->aParent[0] = pRow->aParent[i];
399 pRow->aParent[i] = t;
400 break;
401 }
402
--- src/graph.c
+++ src/graph.c
@@ -391,11 +391,11 @@
391 pParent = hashFind(p, pRow->aParent[0]);
392 if( pParent==0 ) continue; /* Parent off-screen */
393 if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */
394 for(i=1; i<pRow->nParent; i++){
395 pParent = hashFind(p, pRow->aParent[i]);
396 if( pParent && pParent->zBranch==pRow->zBranch ){
397 int t = pRow->aParent[0];
398 pRow->aParent[0] = pRow->aParent[i];
399 pRow->aParent[i] = t;
400 break;
401 }
402

Keyboard Shortcuts

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