From 619d59a2a19c5791ed32076af22ed08d630f123e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Mon, 22 Dec 1997 09:32:59 -0800 Subject: [PATCH] doesn't try to allocate negative size mappings any more Rev: src/encode.c:1.16 --- src/encode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/encode.c b/src/encode.c index 3296f70523..b581b83cf5 100644 --- a/src/encode.c +++ b/src/encode.c @@ -437,7 +437,11 @@ static void decode_value2(struct decode_data *data) case T_MAPPING: { - struct mapping *m=allocate_mapping(num); + struct mapping *m; + if(num<0) + error("Failed to decode string. (mapping size is negative)\n"); + + m=allocate_mapping(num); tmp.type=T_MAPPING; tmp.u.mapping=m; mapping_insert(data->decoded, & data->counter, &tmp); -- GitLab