projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74dd56a
)
fixed buffer overflow
author
Holger Schemel
<holger.schemel@virtion.de>
Sat, 12 Oct 2024 17:52:07 +0000
(19:52 +0200)
committer
Holger Schemel
<holger.schemel@virtion.de>
Sat, 12 Oct 2024 17:52:07 +0000
(19:52 +0200)
src/libgame/text.c
patch
|
blob
|
history
diff --git
a/src/libgame/text.c
b/src/libgame/text.c
index 87cd7dc22a3eba5543fcfe5f591d50402b6c91df..04893897598075ebd9309927d16d3c8eb6db02ea 100644
(file)
--- a/
src/libgame/text.c
+++ b/
src/libgame/text.c
@@
-534,7
+534,7
@@
static void DrawTextBuffer_Flush(int x, int y, char *buffer,
int line_width = font_width * line_length;
int buffer_width = font_width * buffer_len;
int offset_xsize = (centered ? (line_width - buffer_width) / 2 : 0);
- int final_cut_length = M
AX(0, cut_length - offset_chars
);
+ int final_cut_length = M
IN(MAX(0, cut_length - offset_chars), buffer_len
);
int xx = x + offset_xsize;
int yy = y + current_ypos;