Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug 1427 - integer passed to XChangeProperty() causes crash
Julian Coleman 2012-02-20 06:51:12 PST In src/video/x11/SDL_x11video.c, the result of getpid(), i.e., a pid_t is passed to: XChangeProperty(..., 32, ...) However, using 32 here means that Xlib treats the value as a long, and pid_t is an int. So, we get a bus error inside Xlib. The fix is to make sure that anything passed to XChangeProperty() is aligned correctly. Note, that the other calls to XChangeProperty() pass long values here. The proposed patch makes a union of the pid_t return type from getpid() and a dummy long. This has been tested to fix the bus error crash on NetBSD/sparc64.
- Loading branch information