aboutsummaryrefslogtreecommitdiffstats
path: root/node.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-26 21:10:25 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-26 21:10:25 -0400
commita7b4445ceb1d355911a8a367b8db79b225094c43 (patch)
treea8c6db4710384cae3a8d8da228c018c1b8538c7f /node.c
parent2b0495afae3d744127f3b6c18e98819feafbface (diff)
downloadegawk-a7b4445ceb1d355911a8a367b8db79b225094c43.tar.gz
egawk-a7b4445ceb1d355911a8a367b8db79b225094c43.tar.bz2
egawk-a7b4445ceb1d355911a8a367b8db79b225094c43.zip
When checking for trailing spaces in numeric strings, avoid running off the end.
Diffstat (limited to 'node.c')
-rw-r--r--node.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/node.c b/node.c
index 39c25dfd..58b54561 100644
--- a/node.c
+++ b/node.c
@@ -136,7 +136,7 @@ r_force_number(NODE *n)
}
/* POSIX says trailing space is OK for NUMBER */
- while (isspace((unsigned char) *ptr))
+ while (ptr < cpend && isspace((unsigned char) *ptr))
ptr++;
if (errno == 0) {