mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-18 17:41:47 +00:00
fix some UB
This commit is contained in:
parent
3cf2c52fce
commit
73d3d7eec1
2 changed files with 3 additions and 2 deletions
|
@ -347,7 +347,7 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
|
|||
const oper_info *op;
|
||||
lex_ctx_t ctx;
|
||||
ast_expression *out = nullptr;
|
||||
ast_expression *exprs[3];
|
||||
ast_expression *exprs[3] = { 0, 0, 0 };
|
||||
ast_block *blocks[3];
|
||||
ast_binstore *asbinstore;
|
||||
size_t i, assignop, addop, subop;
|
||||
|
|
3
stat.cpp
3
stat.cpp
|
@ -28,11 +28,12 @@ char *stat_mem_strdup(const char *src, bool empty) {
|
|||
* The reallocate function for resizing vectors.
|
||||
*/
|
||||
void _util_vec_grow(void **a, size_t i, size_t s) {
|
||||
vector_t *d = vec_meta(*a);
|
||||
vector_t *d = nullptr;
|
||||
size_t m = 0;
|
||||
void *p = nullptr;
|
||||
|
||||
if (*a) {
|
||||
d = vec_meta(*a);
|
||||
m = 2 * d->allocated + i;
|
||||
p = mem_r(d, s * m + sizeof(vector_t));
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue