[dia] [scan-build] Dereference of null pointer (probably not)
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [scan-build] Dereference of null pointer (probably not)
- Date: Fri, 5 Sep 2014 15:48:36 +0000 (UTC)
commit fa304565eac07348af53a93420125b3134b3a796
Author: Hans Breuer <hans breuer org>
Date: Fri Sep 5 13:26:22 2014 +0200
[scan-build] Dereference of null pointer (probably not)
Make a superfluous check for Any!=NULL a g_return_val_if_fail()
otherwise the static analysis assumes Any could be NULL in this
function an will later complain about the missing check. But
we are never putting NULL into the list of items.
Access to field 'type' results in a dereference of a null pointer
(loaded from variable 'Any')
File: /home/hb/from-git/dia/plug-ins/vdx/vdx-import.c
Line: 1822
plug-ins/vdx/vdx-import.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/vdx/vdx-import.c b/plug-ins/vdx/vdx-import.c
index 145c806..8870994 100644
--- a/plug-ins/vdx/vdx-import.c
+++ b/plug-ins/vdx/vdx-import.c
@@ -1785,7 +1785,8 @@ plot_nurbs(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
while ((item2 = item2->next))
{
Any = (struct vdx_any*)(item2->data);
- if (Any && Any->type != vdx_types_SplineKnot) break;
+ g_return_val_if_fail (Any != NULL, NULL); /* pathologic case */
+ if (Any->type != vdx_types_SplineKnot) break;
n++;
}
k = SplineStart->D;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]