! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Invalid EOF usage causes corrupted display on non-x86 linux
Status:
RESOLVED: DUPLICATE
Severity:
critical
Product:
Xfce4-taskmanager
Component:
General

Comments

Description Subsentient 2013-11-17 12:53:08 CET
Created attachment 5236 
Fixes distorted task list display caused by erroneous usage of EOF on non-x86 architectures.

EOF is 16-bit by definition, but some implementations keep it in the < 255 range, such as x86, which is why it's possible to get away with constructs like the following:

for (i = 0; (c = fgetc(file); ++i)
{
   	gint i;
        gchar c; /*Should be 16-bit or larger.*/

...

	for (i = 0; (c = fgetc (file)) != EOF && i < (gint)sizeof (task->cmdline) - 1; i++)
		task->cmdline[i] = (c == '\0') ? ' ' : c; /*Cast c to gchar to shut up some compilers.*/
	task->cmdline[i] = '\0';
...
}

I have attached a patch that fixes this.
Comment 1 Andre Miranda editbugs 2014-01-09 22:21:07 CET
Duplicate of bug 10417?
At the patches are almost the same.
Comment 2 Landry Breuil editbugs 2014-11-29 12:05:16 CET
Yes, dupe - merging the two bugs.

*** This bug has been marked as a duplicate of bug 10417 ***

Bug #10496

Reported by:
Subsentient
Reported on: 2013-11-17
Last modified on: 2014-11-29

People

Assignee:
Mike Massonnet
CC List:
2 users

Version

Version:
unspecified

Attachments

Additional information