Your message dated Mon, 3 Oct 2016 20:56:53 +0200
with message-id <[email protected]>
and subject line Re: int/long confusion causes xsetbg segfault on AMD64
has caused the Debian Bug report #394366,
regarding int/long confusion causes xsetbg segfault on AMD64
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
394366: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=394366
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xloadimage
Version: 4.1-14.3
A call to XGetWindowProperty() in root.c incorrectly casts between
pointers to ints and longs, causing the values returned from the
function to be incorrect on platforms such as AMD64 where longs are
larger than ints. Under some circumstances, this seems to cause the
program to believe the function has returned a correct value when it
has not, and then dereference a null pointer in the argument to the
following call to XKillClient(), though this crash occurs only
intermittently. (I can see the crash when loading a PPM image with
"xsetbg -fullscreen", but whether it shows up seems to vary depending
on whether I pass the image by filename or on stdin, and other aspects
of the environment; and I wasn't able to reproduce with optimization
disabled for that file or a different GCC version.)
The attached patch fixes the types of the locals used for the return
values to what the function expects, and seems to fix the bug.
-- Stephen
--- root.c.orig 2006-10-20 16:05:45.000000000 -0400
+++ root.c 2006-10-20 16:18:09.000000000 -0400
@@ -68,16 +68,16 @@
Pixmap *pm;
Atom actual_type; /* NOTUSED */
int format;
- int nitems;
- int bytes_after;
+ unsigned long nitems;
+ unsigned long bytes_after;
/* intern the property name */
Atom atom = XInternAtom(dpy, RETAIN_PROP_NAME, 0);
/* look for existing resource allocation */
if ((XGetWindowProperty(dpy, w, atom, 0, 1, 1/*delete*/,
- AnyPropertyType, &actual_type, &format, (unsigned
long *)&nitems,
- (unsigned long *)&bytes_after, (unsigned char **)&pm)
== Success) &&
+ AnyPropertyType, &actual_type, &format, &nitems,
+ &bytes_after, (unsigned char **)&pm) == Success) &&
nitems == 1) {
if ((actual_type == XA_PIXMAP) && (format == 32) &&
(nitems == 1) && (bytes_after == 0)) {
--- End Message ---
--- Begin Message ---
The patch seems to have been applied some time in the past.
signature.asc
Description: PGP signature
--- End Message ---