From fe20a3ce89efec3b9a2b78dcd79b2b0f25c1f12e Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Wed, 11 Dec 2019 10:45:18 +0100 Subject: #580 Fix uninitialized variables in ogAdmServer This patch ensures that some variables are initialized before using them. --- admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c index 562a39de..fa8b487a 100644 --- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c +++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.c @@ -1961,7 +1961,9 @@ static bool RESPUESTA_InventarioHardware(TRAMA* ptrTrama, struct og_client *cli) if (buffer) res=actualizaHardware(dbi, buffer, ido, npc, idc); - + else + res = false; + liberaMemoria(iph); liberaMemoria(ido); liberaMemoria(npc); @@ -2290,6 +2292,8 @@ static bool RESPUESTA_InventarioSoftware(TRAMA* ptrTrama, struct og_client *cli) buffer = rTrim(leeArchivo(sft)); if (buffer) res=actualizaSoftware(dbi, buffer, par, ido, npc, idc); + else + res = false; liberaMemoria(iph); liberaMemoria(ido); @@ -2366,6 +2370,7 @@ bool actualizaSoftware(struct og_dbi *dbi, char *sft, char *par,char *ido, if (lon > MAXSOFTWARE) lon = MAXSOFTWARE; // Limita el número de componentes software + idnombreso = 0; for (i = 0; i < lon; i++) { // Primera línea es el sistema operativo: se obtiene identificador if (i == 0) { -- cgit v1.2.3-18-g5258