Fixed two potential security risks

Fixed two potential security risks reported by Janek Vind "waraxe"
Items 22 and 23
Merge pull request #24 from JoiNNN/master

Fixed two potential security risks