From 6f0815f2e7aa8ff78ccee9f7d2cd378fae0c51d4 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Thu, 27 Apr 2006 18:28:12 +0200 Subject: [PATCH] conf2: fix appending to a dynamic array set to NULL --- lib/conf2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/conf2.c b/lib/conf2.c index ad3839ae..04c20992 100644 --- a/lib/conf2.c +++ b/lib/conf2.c @@ -697,7 +697,7 @@ interpret_add_dynamic(struct cf_item *item, int number, byte **pars, int *proces void *old_p = *ptr; uns size = type_size(item->type, item->u.utype); ASSERT(size >= sizeof(uns)); - int old_nr = * (int*) (old_p - size); + int old_nr = old_p ? * (int*) (old_p - size) : 0; int taken = MIN(number, ABS(item->number)-old_nr); *processed = taken; // stretch the dynamic array -- 2.39.2