From 9940931b0f93c578f324919c2533b59f710c44e8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 2 Jul 2020 22:23:28 +0100 Subject: [PATCH] Fix null dereference in DRC checking. --- libs/kimath/src/geometry/shape_collisions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/kimath/src/geometry/shape_collisions.cpp b/libs/kimath/src/geometry/shape_collisions.cpp index 103f187a4f..fee454c0c0 100644 --- a/libs/kimath/src/geometry/shape_collisions.cpp +++ b/libs/kimath/src/geometry/shape_collisions.cpp @@ -620,7 +620,9 @@ bool SHAPE_RECT::Collide( const SEG& aSeg, int aClearance, int* aActual ) const { if( BBox( 0 ).Contains( aSeg.A ) || BBox( 0 ).Contains( aSeg.B ) ) { - *aActual = 0; + if( aActual ) + *aActual = 0; + return true; }