[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-commit-watch
Subject:    [Gpsd-commit-watch] r3279 - trunk
From:       ckuethe () berlios ! de (ckuethe at BerliOS)
Date:       2006-04-25 0:47:10
Message-ID: 200604250047.k3P0lAsJ013233 () sheep ! berlios ! de
[Download RAW message or body]

Author: ckuethe
Date: 2006-04-25 02:46:35 +0200 (Tue, 25 Apr 2006)
New Revision: 3279

Modified:
   trunk/gpsd.c
Log:
when handling the '$' request in handle_gpsd_request(), whoami->device
could in some cases be NULL, resulting in a segmentation fault. The
attached patch fixes this.

>From Ville Nuorvala on gpsd-dev



Modified: trunk/gpsd.c
===================================================================
--- trunk/gpsd.c	2006-04-12 18:44:40 UTC (rev 3278)
+++ trunk/gpsd.c	2006-04-25 00:46:35 UTC (rev 3279)
@@ -968,7 +968,9 @@
 	    }
 	    break;
         case '$':
-	    if (whoami->device->gpsdata.sentence_time!=0)
+	    if (!assign_channel(whoami))
+		(void)strcpy(phrase, ",$=?");
+	    else if (whoami->device->gpsdata.sentence_time!=0)
 		(void)snprintf(phrase, sizeof(phrase), ",$=%s %d %f %f %f %f %f %f",
 			whoami->device->gpsdata.tag,
 			(int)whoami->device->gpsdata.sentence_length,


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic