Adding length check for the registration response.

Signed-off-by: Jayanga Dissanayake <jsdjayanga@yahoo.com>