xf86-video-intel/tools
Chris Wilson 3140d72826 backlight: Prevent dereference of potential NULL argv
Adam Sampson spotted that

"It's possible (but not very sensible) to exec a program with an empty
argument list, so argv[0] is not necessarily a valid pointer. For
example:

$ cat exec0.c

int main(int argc, char *argv[]) {
    char *empty[1] = { NULL };
    execvp(argv[1], empty);
    perror("execvp");
    return 1;
}
$ ./exec0 /usr/libexec/xf86-video-intel-backlight-helper
Usage: (null) <iface>
"

He sensibly suggested that we hardcode the program name to avoid the
NULL dereference. Being the paranoid type, we should also be careful not
to write to any file descriptors outside of our control (i.e. stderr),
so disable the messages unless we are debugging.

Reported-by: Adam Sampson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-17 16:14:16 +01:00
..
.gitignore intel: Add a helper for setting backlight without root rights 2014-02-15 15:33:47 +00:00
Makefile.am intel-virtual-output: Make it possible to disable building via configure 2014-05-14 17:29:21 +01:00
backlight_helper.c backlight: Prevent dereference of potential NULL argv 2014-07-17 16:14:16 +01:00
intel-virtual-output.man intel: Fix weblinks (again) 2014-06-25 11:45:55 +01:00
org.x.xf86-video-intel.backlight-helper.policy.in Backlight helper build fixes 2014-02-15 17:39:01 +00:00
virtual.c intel-virtual-output: Remove one redundant cleanup on error 2014-06-30 07:44:25 +01:00