mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-13 07:37:15 +03:00
initialise runtime data, which avoids using bad pointers in tls.c as in issue 273
This commit is contained in:
parent
08ce89b6e2
commit
0af37a1bed
@ -1,5 +1,5 @@
|
||||
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
|
||||
* on Wed Jul 29 22:30:25 2020.
|
||||
* on Wed Jul 29 22:51:16 2020.
|
||||
|
||||
# conf2struct: generate libconf parsers that read to structs
|
||||
# Copyright (C) 2018-2019 Yves Rutschle
|
||||
@ -1164,7 +1164,7 @@ static void read_block_init(void* target, config_setting_t* cfg, struct config_d
|
||||
if (setting)
|
||||
len = config_setting_length(setting);
|
||||
}
|
||||
block = malloc(desc->size * len);
|
||||
block = calloc(len, desc->size);
|
||||
|
||||
*(size_t*)(((char*)target) + desc->offset_len) = len;
|
||||
*(void**)(((char*)target) + desc->offset) = block;
|
||||
@ -1172,7 +1172,7 @@ static void read_block_init(void* target, config_setting_t* cfg, struct config_d
|
||||
break;
|
||||
|
||||
case CFG_GROUP:
|
||||
block = malloc(desc->size);
|
||||
block = calloc(1, desc->size);
|
||||
*(void**)(((char*)target) + desc->offset) = block;
|
||||
TRACE_READ((" sizing for %zu elems ", len));
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
|
||||
* on Wed Jul 29 22:30:25 2020.
|
||||
* on Wed Jul 29 22:51:16 2020.
|
||||
|
||||
# conf2struct: generate libconf parsers that read to structs
|
||||
# Copyright (C) 2018-2019 Yves Rutschle
|
||||
|
Loading…
x
Reference in New Issue
Block a user