diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-09-13 16:56:31 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-09-13 16:56:31 +0000 |
commit | 40888a3451249fa704f1780d80974cf89ade4c5e (patch) | |
tree | 4c80261a741ab17cf8f0829ea5f2d7dc1eb58803 | |
parent | 9169473a2e981f2d4d5716c23c1e22c5366b6557 (diff) | |
download | mailfromd-40888a3451249fa704f1780d80974cf89ade4c5e.tar.gz mailfromd-40888a3451249fa704f1780d80974cf89ade4c5e.tar.bz2 |
Bugfix
git-svn-id: file:///svnroot/mailfromd/trunk@1512 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/prog.c | 10 |
2 files changed, 11 insertions, 3 deletions
@@ -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> @@ -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; } |