Merge pull request #1093 from szymonh/master

Enforced buffer boundaries for hid devices