[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] possible driver_ubx runtime bug introduced
From: |
hits |
Subject: |
Re: [gpsd-dev] possible driver_ubx runtime bug introduced |
Date: |
Sun, 13 May 2012 12:43:59 -0400 (EDT) |
thanks for the fix .. for some time i was running with this ubx fix
manually done . i was goin to point out after some more tests . obvious
fix btw ...
-----Original Message-----
From: Jon Schlueter <address@hidden>
To: gpsd-dev list <address@hidden>
Sent: Sat, May 12, 2012 12:58 am
Subject: [gpsd-dev] possible driver_ubx runtime bug introduced
I was looking back through commits and noticed that the ubx_write
parameters changed even though the commit should have been just a
coverty warning fixup. This change could result in a very subtle run
time bug in probing/setting up a UBX gps. I don't have one to check
with but thought I should bring it up on the list.
Jon Schlueter
9d7dc31b595b91aeb258faca459909b0b5b7965e
@@ -714,7 +714,7 @@ static bool ubx_speed(struct gps_device_t *session,
usart_mode |= 0x2000; /* zero value means 1 stop bit */
putle32(buf, 4, usart_mode);
putle32(buf, 8, speed);
- (void)ubx_write(session, 0x06, 0x00, &buf[6], 20); /* send back
with all other settings intact */
+ (void)ubx_write(session, 0x06, 0x00, buf, sizeof(buf)); /* send
back with all other settings intact */
/*@ -charint +usedef +compdef */
return true;
}
also
dbf6d322945e68fce36afd6dba75ab56d60b0c86
@@ -676,7 +675,7 @@ static void ubx_nmea_mode(struct gps_device_t
*session, int mode)
buf[14] |= 0x01; /* turn on UBX output on this port */
}
/*@ -charint +usedef @*/
- (void)ubx_write(session, 0x06u, 0x00, &buf[6], 20); /* send back
with all other settings intact */
+ (void)ubx_write(session, 0x06u, 0x00, buf, sizeof(buf)); /* send
back with all other settings intact */
}