backlight: Fix security issues in handling of the interface path name.
authorMatthieu Herrb <matthieu@herrb.eu>
Fri, 4 Jul 2014 16:26:09 +0000 (18:26 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 4 Jul 2014 19:33:29 +0000 (20:33 +0100)
commit8fa22964f69d3ec8700f177dd7cb3cbc396a9f35
tree3be1162aee548261ba022560b0cfb625a5ff4b68
parent6a64a3ae55ad5f743d2b7a4852b6ca7b54d2a142
backlight: Fix security issues in handling of the interface path name.

- don't allow '/' in the interface name to avoid escaping the /sys
  hierarchy
- check snprintf() return value for overflow.

Problems reported by  Adam Sampson. Thanks.

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Reviewed-by: Hans de Goede <hdegoede@redhat.com>
tools/backlight_helper.c