summaryrefslogtreecommitdiff
path: root/gpsutils.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2007-10-16 01:03:10 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2007-10-16 01:03:10 +0000
commit1e60d1fca0e0269083d439b6e5c9275dd21d118f (patch)
tree7affa3e724df8914461451927d13e4787b7b02b1 /gpsutils.c
parentca6d5e49326dd5ad83310070b0df77228dcac3b1 (diff)
downloadgpsd-1e60d1fca0e0269083d439b6e5c9275dd21d118f.tar.gz
avoid a core dump if somehow one of these pointers is NULL
Diffstat (limited to 'gpsutils.c')
-rw-r--r--gpsutils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gpsutils.c b/gpsutils.c
index b89ece05..fd978b6c 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -105,6 +105,8 @@ void gps_merge_fix(/*@ out @*/struct gps_fix_t *to,
/*@ in @*/struct gps_fix_t *from)
/* merge new data into an old fix */
{
+ if ((NULL == to) || (NULL == from))
+ return;
if ((transfer & TIME_SET)!=0)
to->time = from->time;
if ((transfer & LATLON_SET)!=0) {