Fixing null termination of newly received packets