diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-04-21 11:57:39 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-04-21 11:57:39 -0400 |
commit | 33e7781b5b71eac594b6fa539f6d75939e9b676d (patch) | |
tree | e01dd301660760c6a25a4d784d143464927312db /src/internal/floatscan.c | |
parent | c61312596608bf819b693c04a395f1b4e3e0acf0 (diff) | |
download | musl-33e7781b5b71eac594b6fa539f6d75939e9b676d.tar.gz musl-33e7781b5b71eac594b6fa539f6d75939e9b676d.tar.xz musl-33e7781b5b71eac594b6fa539f6d75939e9b676d.zip |
fix overread (consuming an extra byte) scanning NAN
bug detected by glib test suite
Diffstat (limited to 'src/internal/floatscan.c')
-rw-r--r-- | src/internal/floatscan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c index 7381e9a4..b260381e 100644 --- a/src/internal/floatscan.c +++ b/src/internal/floatscan.c @@ -436,7 +436,7 @@ long double __floatscan(FILE *f, int prec, int pok) return sign * INFINITY; } if (!i) for (i=0; i<3 && (c|32)=="nan"[i]; i++) - if (i<3) c = shgetc(f); + if (i<2) c = shgetc(f); if (i==3) { return NAN; } |