Strip null bytes out of GPC input strings

Backporting commit fc02c46eea9d9e7cc472a7fc1801ea65d467db76 from master
branch to fix issue #17640

Signed-off-by: Damien Regad <dregad@mantisbt.org>