aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-09-13 16:56:31 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-09-13 16:56:31 +0000
commit40888a3451249fa704f1780d80974cf89ade4c5e (patch)
tree4c80261a741ab17cf8f0829ea5f2d7dc1eb58803
parent9169473a2e981f2d4d5716c23c1e22c5366b6557 (diff)
downloadmailfromd-40888a3451249fa704f1780d80974cf89ade4c5e.tar.gz
mailfromd-40888a3451249fa704f1780d80974cf89ade4c5e.tar.bz2
Bugfix
git-svn-id: file:///svnroot/mailfromd/trunk@1512 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog4
-rw-r--r--src/prog.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 79e6ce0b..509a394c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2007-09-13 Sergey Poznyakoff <gray@gnu.org.ua>
+ * src/prog.c (heap_obstack_grow): Bugfix. The condition didn't
+ take into account usignedness.
+ (get_numeric_arg): Extra safety fix.
+
* configure.ac (MAILUTILS_VERSION): Bugfix.
2007-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
diff --git a/src/prog.c b/src/prog.c
index 169ef26c..4d9724cf 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -489,7 +489,11 @@ get_numeric_arg(eval_environ_t env, unsigned n)
void
push(eval_environ_t env, STKVAL val)
{
- if (env->tos <= env->toh) {
+ if (env->tos < env->toh)
+ runtime_error(env, "INTERNAL ERROR at %s:%d, please report",
+ __FILE__, __LINE__);
+
+ if (env->tos == env->toh) {
debug2(100, "tos=%lu, toh=%lu",
(unsigned long) env->tos,
(unsigned long) env->toh);
@@ -557,14 +561,14 @@ heap_obstack_grow(eval_environ_t env, void *ptr, size_t size)
size_t words = B2STACK(size);
char *ret;
- if (words >= env->tos - (env->toh + B2STACK(env->temp_size)))
+ if (env->tos - env->toh < words + B2STACK(env->temp_size))
expand_dataseg(env, words,
_("Memory chunk too big to fit into heap"));
ret = (char*) env_data_ref(env, env->temp_start) + env->temp_size;
if (ptr)
memmove(ret, ptr, size);
env->temp_size += size;
- env->toh += B2STACK(env->temp_size);
+ env->toh += words;
return ret;
}

Return to:

Send suggestions and report system problems to the System administrator.