Fixed another potential overrun in the Discord support code.
This commit is contained in:
@@ -92,11 +92,16 @@ discord_update_activity(int paused)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
temp = strchr(machine_getname(), ']') + 2;
|
temp = strchr(machine_getname(), ']') + 2;
|
||||||
|
|
||||||
if (strlen(temp) <= 127)
|
if (strlen(temp) <= 127)
|
||||||
strcpy(activity.details, temp);
|
strcpy(activity.details, temp);
|
||||||
else
|
else
|
||||||
strncpy(activity.details, temp, 127);
|
strncpy(activity.details, temp, 127);
|
||||||
strcpy(activity.state, machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].name);
|
|
||||||
|
if (strlen(machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].name) <= 127)
|
||||||
|
strcpy(activity.state, machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].name);
|
||||||
|
else
|
||||||
|
strncpy(activity.state, machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].name, 127);
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.timestamps.start = time(NULL);
|
activity.timestamps.start = time(NULL);
|
||||||
|
Reference in New Issue
Block a user