From de0858cf00f410a35a8904883439cebbe4e8d43d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Fri, 15 Feb 2013 08:12:33 +0000 Subject: [PATCH] Possible buffer overflow in HTML generator (code already refactored on HEAD). --- org.glite.lb.server/src/lb_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.glite.lb.server/src/lb_text.c b/org.glite.lb.server/src/lb_text.c index 31d6536..9e15bea 100644 --- a/org.glite.lb.server/src/lb_text.c +++ b/org.glite.lb.server/src/lb_text.c @@ -295,7 +295,7 @@ int edg_wll_ConfigurationToText(edg_wll_Context ctx, int admin, char **message){ if (ctx->authz_policy_file && (fd = open(ctx->authz_policy_file, O_RDONLY)) >= 0){ off_t size = lseek(fd, 0, SEEK_END) - lseek(fd, 0, SEEK_SET); if (size){ - char *pft = (char*)calloc(sizeof(char), size); + char *pft = (char*)calloc(sizeof(char), size + 1); read(fd, pft, size); close(fd); pf = escape_text(pft); -- 1.8.2.3