From 6fc89cdfc42322899391404ef733185f996c0ce9 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 20 Oct 2021 09:53:08 +0200 Subject: #1042 incorrect initialization of software profiles array The position 0 of the software profiles array is not initialized, this triggers a bug randomly on image creation if the position 0 comes zero. Adjust the loop to initialize position 0 accordingly. --- src/ogAdmServer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ogAdmServer.c b/src/ogAdmServer.c index 5d46765..17c9d39 100644 --- a/src/ogAdmServer.c +++ b/src/ogAdmServer.c @@ -891,12 +891,13 @@ bool actualizaSoftware(struct og_dbi *dbi, char *sft, char *par,char *ido, } // Recupera el identificador del software - tbidsoftware[i] = dbi_conn_sequence_last(dbi->conn, NULL); + tbidsoftware[i - 1] = dbi_conn_sequence_last(dbi->conn, NULL); } else { - tbidsoftware[i] = dbi_result_get_uint(result, "idsoftware"); + tbidsoftware[i - 1] = dbi_result_get_uint(result, "idsoftware"); } dbi_result_free(result); } + lon--; // Ordena tabla de identificadores para cosultar si existe un pefil con esas especificaciones -- cgit v1.2.3-18-g5258