From 56ff36668bb4df17ab12c693bf6f01bf1de67517 Mon Sep 17 00:00:00 2001 From: Vitaly Davydov Date: Fri, 25 Aug 2023 16:50:25 +0300 Subject: [PATCH] Fix sphereline_circle_pos (uninitialized memory use) --- expected/overlaps.out | 4 ++-- src/line.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/expected/overlaps.out b/expected/overlaps.out index 5a7625f..5b1f885 100644 --- a/expected/overlaps.out +++ b/expected/overlaps.out @@ -835,14 +835,14 @@ select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sci select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(10d , 0d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- - sbox && scircle | f | f + sbox && scircle | f | t (1 row) -- the box degenerated into the point lies in the interior of circle select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(0d , 0d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- - sbox && scircle | f | f + sbox && scircle | f | t (1 row) -- the box and circle are degenerated into the point and coincide diff --git a/src/line.c b/src/line.c index 6599e64..ad02575 100644 --- a/src/line.c +++ b/src/line.c @@ -349,7 +349,7 @@ sphereline_circle_pos(const SLine *sl, const SCIRCLE *sc) { /* line is point */ sline_begin(&p[0], sl); - if (spoint_in_circle(&p[0], &c)) + if (spoint_in_circle(&p[0], sc)) { return PGS_CIRCLE_CONT_LINE; }