pfr_fix_anchor() strips leading slashes before checking that the
anchor is NUL terminated. With an anchor made only of slashes the
scan runs past the end of the buffer and siz - off underflows in the
bcopy().
Check termination first. 1da3c0ca5b1 only did this for
DIOCRCLRTABLES. This covers the other callers. Add test cases for
DIOCRADDTABLES, DIOCRDELTABLES and DIOCRSETTFLAGS.
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>