Fossil SCM
Increase the size of the aPriority[] array in graph.c by one to ensure it never overflows. [forum:/info/2026-07-31T06:40:58Z|Forum 2026-07-31T06:40:58Z]
Commit
a8bf88f8ffab98dd404bc95867fc8f46ff0c564f4bd5cf9c401729f6007f02ab
Parent
6ab3ff5f778652b…
1 file changed
+1
-1
+1
-1
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -1011,11 +1011,11 @@ | ||
| 1011 | 1011 | ** is defined. This improves the display of r=BRANCH |
| 1012 | 1012 | ** options to /timeline. |
| 1013 | 1013 | ** |
| 1014 | 1014 | ** 0x01 A rail that merges with the preferred branch |
| 1015 | 1015 | */ |
| 1016 | - u16 aPriority[GR_MAX_RAIL]; | |
| 1016 | + u16 aPriority[GR_MAX_RAIL+1]; | |
| 1017 | 1017 | int mxMatch = 0; |
| 1018 | 1018 | memset(aPriority, 0, (p->mxRail+1)*sizeof(aPriority[0])); |
| 1019 | 1019 | if( pLeftBranch ){ |
| 1020 | 1020 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 1021 | 1021 | int iMatch = match_text(pLeftBranch, pRow->zBranch); |
| 1022 | 1022 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -1011,11 +1011,11 @@ | |
| 1011 | ** is defined. This improves the display of r=BRANCH |
| 1012 | ** options to /timeline. |
| 1013 | ** |
| 1014 | ** 0x01 A rail that merges with the preferred branch |
| 1015 | */ |
| 1016 | u16 aPriority[GR_MAX_RAIL]; |
| 1017 | int mxMatch = 0; |
| 1018 | memset(aPriority, 0, (p->mxRail+1)*sizeof(aPriority[0])); |
| 1019 | if( pLeftBranch ){ |
| 1020 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 1021 | int iMatch = match_text(pLeftBranch, pRow->zBranch); |
| 1022 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -1011,11 +1011,11 @@ | |
| 1011 | ** is defined. This improves the display of r=BRANCH |
| 1012 | ** options to /timeline. |
| 1013 | ** |
| 1014 | ** 0x01 A rail that merges with the preferred branch |
| 1015 | */ |
| 1016 | u16 aPriority[GR_MAX_RAIL+1]; |
| 1017 | int mxMatch = 0; |
| 1018 | memset(aPriority, 0, (p->mxRail+1)*sizeof(aPriority[0])); |
| 1019 | if( pLeftBranch ){ |
| 1020 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 1021 | int iMatch = match_text(pLeftBranch, pRow->zBranch); |
| 1022 |