Fossil SCM

Fix off-by-one error in the array sizing of an array in graph_finish().

drh 2026-08-11 11:39 UTC trunk
Commit 001420ad783ffae40b4676fe050f61c077017180cd57811770d0d90af56089eb
1 file changed +1 -1
+1 -1
--- src/graph.c
+++ src/graph.c
@@ -523,11 +523,11 @@
523523
524524
/* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
525525
** coming up from the bottom of the graph from off-screen check-in Y
526526
** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
527527
*/
528
- GraphRowId mergeRiserFrom[GR_MAX_RAIL];
528
+ GraphRowId mergeRiserFrom[GR_MAX_RAIL+1];
529529
530530
if( p==0 || p->pFirst==0 || p->nErr ) return;
531531
p->nErr = 1; /* Assume an error until proven otherwise */
532532
533533
/* Initialize all rows */
534534
--- src/graph.c
+++ src/graph.c
@@ -523,11 +523,11 @@
523
524 /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
525 ** coming up from the bottom of the graph from off-screen check-in Y
526 ** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
527 */
528 GraphRowId mergeRiserFrom[GR_MAX_RAIL];
529
530 if( p==0 || p->pFirst==0 || p->nErr ) return;
531 p->nErr = 1; /* Assume an error until proven otherwise */
532
533 /* Initialize all rows */
534
--- src/graph.c
+++ src/graph.c
@@ -523,11 +523,11 @@
523
524 /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
525 ** coming up from the bottom of the graph from off-screen check-in Y
526 ** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
527 */
528 GraphRowId mergeRiserFrom[GR_MAX_RAIL+1];
529
530 if( p==0 || p->pFirst==0 || p->nErr ) return;
531 p->nErr = 1; /* Assume an error until proven otherwise */
532
533 /* Initialize all rows */
534

Keyboard Shortcuts

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