[hackers] [sbase] Add explicit boundary to loop in readrune() || FRIGN
commit 22f40b5a03bf9c1a73cc325922bdbe147d6de7c3
Author: FRIGN <dev_AT_frign.de>
Date: Sun Feb 1 04:20:02 2015 +0100
Add explicit boundary to loop in readrune()
You never know what could happen. Better have a "blind" read than
a segmentation fault.
diff --git a/libutf/readrune.c b/libutf/readrune.c
index 8bab478..3fda9ef 100644
--- a/libutf/readrune.c
+++ b/libutf/readrune.c
_AT_@ -27,7 +27,7 @@ readrune(const char *file, FILE *fp, Rune *r)
}
buf[0] = c;
- for (i = 1; ;) {
+ for (i = 1; i < UTFmax; ) {
if ((c = fgetc(fp)) == EOF) {
if (ferror(fp)) {
fprintf(stderr, "%s: read error: %s\n",
Received on Tue Mar 24 2015 - 23:53:33 CET
This archive was generated by hypermail 2.3.0
: Wed Mar 25 2015 - 00:07:51 CET