[PATCH] Potential overflow and unused variable