summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2021-10-20 09:53:08 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-10-20 09:57:41 +0200
commit6fc89cdfc42322899391404ef733185f996c0ce9 (patch)
tree0a7b09b945a2951c5ec04238e3a97532c8d54ccc
parente16f36cdef55d6a2598e25144f583dfad0c9c793 (diff)
#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.
-rw-r--r--src/ogAdmServer.c5
1 files 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