fixed null pointer arithmetic