chiark
/
gitweb
/
~bjharris
/
bedstead.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f955f3
)
Add assertions that we don't overflow the "points" array
author
Ben Harris
<bjh21@bjh21.me.uk>
Sun, 16 Nov 2025 13:54:31 +0000
(13:54 +0000)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Tue, 13 Jan 2026 21:55:10 +0000
(21:55 +0000)
bedstead.c
patch
|
blob
|
history
diff --git
a/bedstead.c
b/bedstead.c
index 172492bdcced4b08269e361e9090688836c92590..52afbb3ab0c317cede3e2472f657ddb7ed5d59dd 100644
(file)
--- a/
bedstead.c
+++ b/
bedstead.c
@@
-4366,6
+4366,7
@@
moveto(int x, int y)
{
struct point *p = &points[nextpoint++];
+ assert(nextpoint <= MAXPOINTS);
p->v.x = x; p->v.y = y;
p->next = p->prev = NULL;
}
@@
-4375,6
+4376,7
@@
lineto(int x, int y)
{
struct point *p = &points[nextpoint++];
+ assert(nextpoint <= MAXPOINTS);
p->v.x = x; p->v.y = y;
p->next = NULL;
p->prev = p - 1;