From 6ea8d99809286eb801ab908fb78fcc6958005afd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Nov 2015 16:34:25 +0800 Subject: [PATCH] parser_yin BUGFIX when realloc models list, the buffer size is wrong --- src/parser_yin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser_yin.c b/src/parser_yin.c index 601df6757..7e5e6091b 100644 --- a/src/parser_yin.c +++ b/src/parser_yin.c @@ -5093,7 +5093,7 @@ yin_read_module(struct ly_ctx *ctx, const char *data, int implement, struct unre /* add to the context's list of modules */ if (ctx->models.used == ctx->models.size) { - newlist = realloc(ctx->models.list, ctx->models.size * 2); + newlist = realloc(ctx->models.list, sizeof(struct lys_module *) * ctx->models.size * 2); if (!newlist) { LOGMEM; goto error;