Fossil SCM
Fix a NULL-pointer dereference bug in the graph generator.
Commit
03250bc6490de95f4e271533ae57b74d3ee4bd85
Parent
49976900788c768…
1 file changed
+1
-1
+1
-1
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -391,11 +391,11 @@ | ||
| 391 | 391 | pParent = hashFind(p, pRow->aParent[0]); |
| 392 | 392 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 393 | 393 | if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */ |
| 394 | 394 | for(i=1; i<pRow->nParent; i++){ |
| 395 | 395 | pParent = hashFind(p, pRow->aParent[i]); |
| 396 | - if( pParent->zBranch==pRow->zBranch ){ | |
| 396 | + if( pParent && pParent->zBranch==pRow->zBranch ){ | |
| 397 | 397 | int t = pRow->aParent[0]; |
| 398 | 398 | pRow->aParent[0] = pRow->aParent[i]; |
| 399 | 399 | pRow->aParent[i] = t; |
| 400 | 400 | break; |
| 401 | 401 | } |
| 402 | 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->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 |