#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.
master
OpenGnSys Support Team 2021-10-20 09:53:08 +02:00
parent e16f36cdef
commit 6fc89cdfc4
1 changed files with 3 additions and 2 deletions

View File

@ -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