merge fix

This commit is contained in:
maliakal_d 2021-11-17 10:13:44 +01:00
commit f7286d29fa
13 changed files with 21 additions and 23 deletions

View File

@ -137,8 +137,6 @@ sls_enable_cxx_warning("-Wnull-dereference")
sls_enable_cxx_warning("-Wduplicated-cond")
sls_disable_cxx_warning("-Wclass-memaccess")
sls_disable_c_warning("-Wstringop-truncation")
sls_disable_c_warning("-Wformat-nonliteral")
sls_disable_c_warning("-Wformat-truncation")
if(SLS_USE_SANITIZER)

View File

@ -477,8 +477,9 @@ int setupDetectorServer(char *mess, char *sname) {
LOG(logINFO, ("\tinittab: DetectoServer line deleted\n"));
// add new link name to /etc/inittab
char *format = "echo 'ttyS0::respawn:/./%s' >> /etc/inittab";
if (snprintf(cmd, MAX_STR_LENGTH, format, linkname) >= MAX_STR_LENGTH) {
if (snprintf(cmd, MAX_STR_LENGTH,
"echo 'ttyS0::respawn:/./%s' >> /etc/inittab",
linkname) >= MAX_STR_LENGTH) {
strcpy(mess, "Could not copy detector server. Command "
"to add new server for spawning is too long\n");
LOG(logERROR, (mess));
@ -584,8 +585,8 @@ int moveBinaryFile(char *mess, char *dest, char *src, char *errorPrefix) {
// one can move into the current process binary (will not interfere in
// kernel mode)
char *format = "mv %s %s";
if (snprintf(cmd, MAX_STR_LENGTH, format, src, dest) >= MAX_STR_LENGTH) {
if (snprintf(cmd, MAX_STR_LENGTH, "mv %s %s", src, dest) >=
MAX_STR_LENGTH) {
sprintf(mess, "Could not %s. Command to move binary is too long\n",
errorPrefix);
LOG(logERROR, (mess));

View File

@ -225,8 +225,7 @@ int emptyTempFolder(char *mess) {
char cmd[MAX_STR_LENGTH] = {0};
char retvals[MAX_STR_LENGTH] = {0};
char *format = "rm -fr %s";
if (snprintf(cmd, MAX_STR_LENGTH, format,
if (snprintf(cmd, MAX_STR_LENGTH, "rm -fr %s",
TEMP_PROG_FOLDER_NAME_ALL_FILES) >= MAX_STR_LENGTH) {
sprintf(mess,
"Could not update %s. Command to empty %s folder is too long\n",
@ -433,8 +432,7 @@ int eraseFlash(char *mess) {
#endif
char cmd[MAX_STR_LENGTH] = {0};
char retvals[MAX_STR_LENGTH] = {0};
char *format = "flash_eraseall %s";
if (snprintf(cmd, MAX_STR_LENGTH, format, flashDriveName) >=
if (snprintf(cmd, MAX_STR_LENGTH, "flash_eraseall %s", flashDriveName) >=
MAX_STR_LENGTH) {
sprintf(mess, "Could not %s. Command to erase flash is too long\n",
messageType);

View File

@ -167,8 +167,7 @@ int eraseFlash(char *mess) {
char cmd[MAX_STR_LENGTH] = {0};
char retvals[MAX_STR_LENGTH] = {0};
char *format = "flash_erase %s 0 0";
if (snprintf(cmd, MAX_STR_LENGTH, format, flashDriveName) >=
if (snprintf(cmd, MAX_STR_LENGTH, "flash_erase %s 0 0", flashDriveName) >=
MAX_STR_LENGTH) {
sprintf(mess, "Could not %s. Command to erase flash is too long\n",
messageType);

View File

@ -4144,9 +4144,8 @@ int copy_detector_server(int file_des) {
char cmd[MAX_STR_LENGTH] = {0};
// tftp server
char *format = "tftp %s -r %s -g";
if (snprintf(cmd, MAX_STR_LENGTH, format, hostname, sname) >=
MAX_STR_LENGTH) {
if (snprintf(cmd, MAX_STR_LENGTH, "tftp %s -r %s -g", hostname,
sname) >= MAX_STR_LENGTH) {
ret = FAIL;
strcpy(mess, "Could not copy detector server. Command to copy "
"server too long\n");
@ -9255,8 +9254,11 @@ int get_kernel_version(int file_des) {
// get only
ret = getKernelVersion(retvals);
if (ret == FAIL) {
snprintf(mess, MAX_STR_LENGTH, "Could not get kernel version. %s\n",
retvals);
if (snprintf(mess, MAX_STR_LENGTH, "Could not get kernel version. %s\n",
retvals) >= MAX_STR_LENGTH) {
ret = FAIL;
strcpy(mess, "Could not get kernel version. Reason too long to copy\n");
}
LOG(logERROR, (mess));
} else {
LOG(logDEBUG1, ("kernel version: [%s]\n", retvals));

View File

@ -6,10 +6,10 @@
#define APILIB 0x211027
#define APIRECEIVER 0x211020
#define APIGUI 0x211021
#define APICTB 0x211111
#define APIGOTTHARD 0x211111
#define APIGOTTHARD2 0x211111
#define APIJUNGFRAU 0x211111
#define APIMYTHEN3 0x211111
#define APICTB 0x211117
#define APIGOTTHARD 0x211117
#define APIGOTTHARD2 0x211117
#define APIJUNGFRAU 0x211117
#define APIMYTHEN3 0x211117
#define APIMOENCH 0x211111
#define APIEIGER 0x211111
#define APIEIGER 0x211117