summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--src/mystring.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 60bdfb5..47a4bb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-10-17  Oleg Verych <olecom@flower.upol.cz>
+
+	* Disallow completely blank strings in non-arithmetic context.
+
 2007-10-15  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Fixed execing of scripts with no hash-bang.
diff --git a/src/mystring.c b/src/mystring.c
index b84b7e2..8e1200a 100644
--- a/src/mystring.c
+++ b/src/mystring.c
@@ -123,6 +123,13 @@ intmax_t atomax(const char *s, int base)
 	if (errno != 0)
 		sh_error(illnum, s);
 
+	/*
+	 * Disallow completely blank strings in non-arithmetic (base != 0)
+	 * contexts.
+	 */
+	if (base && (p == s))
+		sh_error(illnum, s);
+
 	while (isspace((unsigned char)*p))
 	      p++;
 
itle='2014-04-17 12:55:09 +0200'>2014-04-17remove trailing whitespaces from source filesChristian Hesse 2014-04-12git: update to 1.9.2Christian Hesse 2014-04-05Fix cgit_parse_url when a repo url is contained in another repo urlJulian Maurice 2014-03-20Makefile: use more reliable git tarball mirrorJason A. Donenfeld 2014-03-20git: update to 1.9.1Christian Hesse