324 lines
10 KiB
Diff
324 lines
10 KiB
Diff
diff '--color=auto' -uNr work.orig/ascii.c work/ascii.c
|
|
--- work.orig/ascii.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/ascii.c 2026-04-07 20:15:50.887432949 +0200
|
|
@@ -610,7 +610,7 @@
|
|
sprintf (err, txt, command);
|
|
break;
|
|
default:
|
|
- sprintf (err, txt);
|
|
+ snprintf(err, sizeof(err), "%s", txt);
|
|
break;
|
|
}
|
|
sprintf (result,"**00000 RESULT ERROR: %s",err);
|
|
@@ -708,7 +708,9 @@
|
|
#endif
|
|
if (!fp) continue;
|
|
|
|
- fread (&mem[pos],1,dir->dir[cnt].len,fp);
|
|
+ if (fread(&mem[pos], 1, dir->dir[cnt].len, fp) != (size_t)dir->dir[cnt].len) {
|
|
+ /* ignore short read */
|
|
+ }
|
|
fclose (fp);
|
|
|
|
dir->dir[cnt].adr = pos;
|
|
@@ -807,7 +809,7 @@
|
|
strcat (result,";");
|
|
|
|
atime = localtime (&fst.st_mtime);
|
|
- sprintf (st,"%d;%02d.%02d.%04d %02d:%02d;",fst.st_size,atime->tm_mday,atime->tm_mon+1,atime->tm_year + 1900,atime->tm_hour,atime->tm_min);
|
|
+ sprintf (st,"%ld;%02d.%02d.%04d %02d:%02d;",(long)fst.st_size,atime->tm_mday,atime->tm_mon+1,atime->tm_year + 1900,atime->tm_hour,atime->tm_min);
|
|
strcat (result,st);
|
|
|
|
len = (word)strlen (result);
|
|
@@ -834,7 +836,7 @@
|
|
strcat (result,";");
|
|
|
|
atime = localtime (&fst.st_mtime);
|
|
- sprintf (st,"%d;%02d.%02d.%04d %02d:%02d;",fst.st_size,atime->tm_mday,atime->tm_mon+1,atime->tm_year + 1900,atime->tm_hour,atime->tm_min);
|
|
+ sprintf (st,"%ld;%02d.%02d.%04d %02d:%02d;",(long)fst.st_size,atime->tm_mday,atime->tm_mon+1,atime->tm_year + 1900,atime->tm_hour,atime->tm_min);
|
|
strcat (result,st);
|
|
|
|
len = strlen (result);
|
|
diff '--color=auto' -uNr work.orig/errormessage.c work/errormessage.c
|
|
--- work.orig/errormessage.c 2026-04-07 19:41:30.977000238 +0200
|
|
+++ work/errormessage.c 2026-04-07 20:15:50.887640731 +0200
|
|
@@ -91,7 +91,7 @@
|
|
struct _timeb tb;
|
|
#endif
|
|
#ifdef LINUX
|
|
- struct timeb tb;
|
|
+ struct timeval tv_linux;
|
|
#endif
|
|
|
|
if (logfp) fp = logfp;
|
|
@@ -107,10 +107,15 @@
|
|
_ftime (&tb);
|
|
#endif
|
|
#ifdef LINUX
|
|
- ftime (&tb);
|
|
+ gettimeofday(&tv_linux, NULL);
|
|
#endif
|
|
+#ifdef WIN32
|
|
tv = tb.time;
|
|
ms = tb.millitm;
|
|
+#endif
|
|
+#ifdef LINUX
|
|
+ ms = (int)(tv_linux.tv_usec / 1000);
|
|
+#endif
|
|
tmpnt = localtime (&tv);
|
|
|
|
fprintf (fp,"%4d-%02d-%02d %02d:%02d:%02d.%03d %s",tmpnt->tm_year+1900,tmpnt->tm_mon+1,tmpnt->tm_mday,tmpnt->tm_hour,tmpnt->tm_min,tmpnt->tm_sec,ms,msg);
|
|
diff '--color=auto' -uNr work.orig/fileio.c work/fileio.c
|
|
--- work.orig/fileio.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/fileio.c 2026-04-07 20:15:50.887868293 +0200
|
|
@@ -525,7 +525,9 @@
|
|
}
|
|
#endif
|
|
#ifdef LINUX
|
|
- truncate (client->filename,pos);
|
|
+ if (truncate(client->filename, pos) != 0) {
|
|
+ /* ignore failure */
|
|
+ }
|
|
#endif
|
|
}
|
|
|
|
diff '--color=auto' -uNr work.orig/flashrom.c work/flashrom.c
|
|
--- work.orig/flashrom.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/flashrom.c 2026-04-07 20:15:50.888147884 +0200
|
|
@@ -1763,7 +1763,9 @@
|
|
}
|
|
if (!strncmp (st,"[ACTION]",8)) {
|
|
fseek (fptrans,pos+10,SEEK_SET);
|
|
- fread (irdb[trans_num].action,1,irdb[trans_num].action_len,fptrans);
|
|
+ if (fread(irdb[trans_num].action, 1, irdb[trans_num].action_len, fptrans) != (size_t)irdb[trans_num].action_len) {
|
|
+ /* ignore short read */
|
|
+ }
|
|
}
|
|
if (!strncmp (st,"[RELAIS]",8)) irdb[trans_num].relais = st[8] + ((st[9] & 2) << 6) + ((st[9] & 1) << 1);
|
|
if (!strncmp (st,"[ACTYPE]",8)) {
|
|
Binärdateien work.orig/irserver64 und work/irserver64 sind verschieden.
|
|
diff '--color=auto' -uNr work.orig/lanio.c work/lanio.c
|
|
--- work.orig/lanio.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/lanio.c 2026-04-07 20:15:50.888397749 +0200
|
|
@@ -138,7 +138,7 @@
|
|
LARGE_INTEGER time_ack;
|
|
#endif
|
|
#ifdef LINUX
|
|
- struct timeb tb;
|
|
+ struct timeval tv;
|
|
long long int time_start;
|
|
long long int time_ack;
|
|
#endif
|
|
@@ -265,14 +265,14 @@
|
|
QueryPerformanceCounter (&time_ack);
|
|
timediff = (unsigned long)((time_ack.QuadPart - time_start.QuadPart) / counterRes.QuadPart);
|
|
#else
|
|
- ftime (&tb);
|
|
- time_start = tb.time * 10000 + tb.millitm * 10;
|
|
+ gettimeofday(&tv, NULL);
|
|
+ time_start = (long long)tv.tv_sec * 10000 + tv.tv_usec / 100;
|
|
do {
|
|
res = rcv_status_timeout (50,target.sin_addr.s_addr);
|
|
} while (res == COMMAND_SEND_ACK2);
|
|
|
|
- ftime (&tb);
|
|
- time_ack = tb.time * 10000 + tb.millitm * 10;
|
|
+ gettimeofday(&tv, NULL);
|
|
+ time_ack = (long long)tv.tv_sec * 10000 + tv.tv_usec / 100;
|
|
timediff = time_ack - time_start;
|
|
#endif
|
|
|
|
@@ -288,8 +288,8 @@
|
|
#else
|
|
res = rcv_status_timeout (50,target.sin_addr.s_addr);
|
|
|
|
- ftime (&tb);
|
|
- time_ack = tb.time * 10000 + tb.millitm * 10;
|
|
+ gettimeofday(&tv, NULL);
|
|
+ time_ack = (long long)tv.tv_sec * 10000 + tv.tv_usec / 100;
|
|
timediff = time_ack - time_start;
|
|
#endif
|
|
if (res == -1) return (ERR_TIMEOUT);
|
|
@@ -305,8 +305,8 @@
|
|
#else
|
|
res = rcv_status_timeout (2000,target.sin_addr.s_addr);
|
|
|
|
- ftime (&tb);
|
|
- time_ack = tb.time * 10000 + tb.millitm * 10;
|
|
+ gettimeofday(&tv, NULL);
|
|
+ time_ack = (long long)tv.tv_sec * 10000 + tv.tv_usec / 100;
|
|
timediff = time_ack - time_start;
|
|
#endif
|
|
}
|
|
diff '--color=auto' -uNr work.orig/server.c work/server.c
|
|
--- work.orig/server.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/server.c 2026-04-07 20:15:50.888696956 +0200
|
|
@@ -944,7 +944,9 @@
|
|
int vers;
|
|
vers = GetOSInfo ();
|
|
if (vers >= 510 && (vers & 1)) { // Running on x64 (WOW64)
|
|
- if (serverdir[0]) chdir (serverdir);
|
|
+ if (serverdir[0] && chdir(serverdir) != 0) {
|
|
+ /* ignore failure */
|
|
+ }
|
|
if (_execv (".\\irserver64.exe",argv)) {
|
|
fprintf (stderr,"Error executing the 64Bit IRServer\n");
|
|
exit (-1);
|
|
@@ -960,7 +962,9 @@
|
|
uname (&u);
|
|
if (!strcmp (u.machine,"x86_64")) { // Running on x64
|
|
argv[0] = "irserver64";
|
|
- if (serverdir[0]) chdir (serverdir);
|
|
+ if (serverdir[0] && chdir(serverdir) != 0) {
|
|
+ /* ignore failure */
|
|
+ }
|
|
if (execv ("./irserver64",argv)) {
|
|
fprintf (stderr,"Error executing the 64Bit IRServer\n");
|
|
exit (-1);
|
|
@@ -995,7 +999,9 @@
|
|
return (get_devices (st,1));
|
|
}
|
|
|
|
- if (serverdir[0]) chdir (serverdir);
|
|
+ if (serverdir[0] && chdir(serverdir) != 0) {
|
|
+ /* ignore failure */
|
|
+ }
|
|
|
|
argc++;
|
|
|
|
@@ -2703,7 +2709,7 @@
|
|
if (sockinfo[i].type == SELECT_SERVER || sockinfo[i].type == SELECT_REOPEN) {
|
|
if (sockinfo[i].mode >= MODE_ASCII) {
|
|
sprintf (msg,"**00000 RCV_COM %s,%s,%d,%d\n",rem,name,0,0);
|
|
- sprintf (msg+2,"%05d",strlen (msg));
|
|
+ sprintf (msg+2,"%05zu",strlen (msg));
|
|
msg[7] = ' ';
|
|
res = send (sockinfo[i].fd,msg,(int)strlen (msg),MSG_NOSIGNAL);
|
|
}
|
|
@@ -2803,7 +2809,7 @@
|
|
}
|
|
else if (sockinfo[i].mode >= MODE_ASCII) {
|
|
sprintf (msg,"**00000 RCV_COM %s,%s,%d,%d\n",rem,name,bus,*command & 15);
|
|
- sprintf (msg+2,"%05d",strlen (msg));
|
|
+ sprintf (msg+2,"%05zu",strlen (msg));
|
|
msg[7] = ' ';
|
|
res = send (sockinfo[i].fd,msg,(int)strlen (msg),MSG_NOSIGNAL);
|
|
}
|
|
@@ -2860,7 +2866,7 @@
|
|
}
|
|
else if (sockinfo[i].mode >= MODE_ASCII) {
|
|
sprintf (msg,"**00000 RCV_COD %s,%d,%d\n",command+1,bus,*command & 15);
|
|
- sprintf (msg+2,"%05d",strlen (msg));
|
|
+ sprintf (msg+2,"%05zu",strlen (msg));
|
|
msg[7] = ' ';
|
|
res = send (sockinfo[i].fd,msg,(int)strlen (msg),MSG_NOSIGNAL);
|
|
}
|
|
@@ -2870,7 +2876,7 @@
|
|
i++;
|
|
}
|
|
if (mode_flag & DEBUG_CODE) {
|
|
- sprintf (msg,"[%d.%d]: LEN: %d %s\n",bus,(*command & 15),strlen(command+1),command+1);
|
|
+ sprintf (msg,"[%d.%d]: LEN: %zu %s\n",bus,(*command & 15),strlen(command+1),command+1);
|
|
log_print (msg,LOG_FATAL);
|
|
}
|
|
}
|
|
@@ -3861,7 +3867,9 @@
|
|
}
|
|
#endif
|
|
#ifdef LINUX
|
|
- truncate (st,res);
|
|
+ if (truncate(st, res) != 0) {
|
|
+ /* ignore failure */
|
|
+ }
|
|
#endif
|
|
|
|
ReadIRDatabase ();
|
|
@@ -5527,7 +5535,9 @@
|
|
if (new) chmod (LIRCD,PERMISSIONS);
|
|
else {
|
|
chmod(LIRCD,s.st_mode);
|
|
- chown(LIRCD,s.st_uid,s.st_gid);
|
|
+ if (chown(LIRCD, s.st_uid, s.st_gid) != 0) {
|
|
+ /* ignore failure */
|
|
+ }
|
|
}
|
|
|
|
listen(local_socket,3);
|
|
@@ -5751,7 +5761,7 @@
|
|
sprintf (err, txt, command);
|
|
break;
|
|
default:
|
|
- sprintf (err, txt);
|
|
+ snprintf(err, sizeof(err), "%s", txt);
|
|
break;
|
|
}
|
|
log_print (err, LOG_ERROR);
|
|
diff '--color=auto' -uNr work.orig/webserver.c work/webserver.c
|
|
--- work.orig/webserver.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/webserver.c 2026-04-07 20:15:50.889051906 +0200
|
|
@@ -619,7 +619,7 @@
|
|
strcat (mem,"Date: Sun, 21 Dec 2003 23:10:01 GMT\r\n");
|
|
strcat (mem,"Server: IRTrans 2.0\r\n");
|
|
strcat (mem,"Mime-Version: 1.0\r\n");
|
|
- sprintf (ln,"Content-Type: text/html\r\nContent-Length: %6d\r\n",strlen (body));
|
|
+ sprintf (ln,"Content-Type: text/html\r\nContent-Length: %6zu\r\n",strlen (body));
|
|
strcat (mem,ln);
|
|
|
|
strcat (mem,"Expires: Sun, 21 Dec 2003 23:10:01 GMT\r\n");
|
|
Binärdateien work.orig/x64/ascii.o und work/x64/ascii.o sind verschieden.
|
|
Binärdateien work.orig/x64/errormessage.o und work/x64/errormessage.o sind verschieden.
|
|
Binärdateien work.orig/x64/flashrom.o und work/x64/flashrom.o sind verschieden.
|
|
Binärdateien work.orig/x64/lanio.o und work/x64/lanio.o sind verschieden.
|
|
Binärdateien work.orig/x64/server.o und work/x64/server.o sind verschieden.
|
|
Binärdateien work.orig/x64/webserver.o und work/x64/webserver.o sind verschieden.
|
|
Binärdateien work.orig/x64/xap.o und work/x64/xap.o sind verschieden.
|
|
Binärdateien work.orig/x64/xbmc.o und work/x64/xbmc.o sind verschieden.
|
|
diff '--color=auto' -uNr work.orig/xap.c work/xap.c
|
|
--- work.orig/xap.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/xap.c 2026-04-07 20:15:50.889221981 +0200
|
|
@@ -249,7 +249,7 @@
|
|
sprintf (err,txt,(adr >> 20) & (MAX_IR_DEVICES - 1));
|
|
break;
|
|
default:
|
|
- sprintf (err, txt);
|
|
+ snprintf(err, sizeof(err), "%s", txt);
|
|
break;
|
|
}
|
|
log_print (err, LOG_ERROR);
|
|
diff '--color=auto' -uNr work.orig/xbmc.c work/xbmc.c
|
|
--- work.orig/xbmc.c 2026-04-07 19:41:30.978184847 +0200
|
|
+++ work/xbmc.c 2026-04-07 20:19:47.129476172 +0200
|
|
@@ -183,7 +183,9 @@
|
|
#endif
|
|
|
|
#ifdef LINUX
|
|
- system (app->appname);
|
|
+ if (system(app->appname) == -1) {
|
|
+ /* ignore failure */
|
|
+ }
|
|
#endif
|
|
|
|
}
|
|
@@ -263,7 +265,9 @@
|
|
|
|
fp = popen( "ps aux|grep -v grep|grep -i xbmc.bin", "r");
|
|
|
|
- fgets (ln,sizeof (ln),fp);
|
|
+ if (!fgets(ln, sizeof(ln), fp)) {
|
|
+ ln[0] = 0;
|
|
+ }
|
|
|
|
pclose (fp);
|
|
|
|
@@ -272,7 +276,9 @@
|
|
|
|
if (!ln[i]) {
|
|
fp = popen( "ps aux|grep -v grep|grep -i kodi.bin", "r");
|
|
- fgets (ln,sizeof (ln),fp);
|
|
+ if (!fgets(ln, sizeof(ln), fp)) {
|
|
+ ln[0] = 0;
|
|
+ }
|
|
pclose (fp);
|
|
i = 0;
|
|
while (ln[i] && ln[i] != ' ' && ln[i] != '\t') i++;
|