gpsd-commit-watch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-commit-watch] [SCM] GPSD branch, master, updated. release-3.15-45-


From: Jon Schlueter
Subject: [gpsd-commit-watch] [SCM] GPSD branch, master, updated. release-3.15-45-gfd00555
Date: Sat, 03 Oct 2015 12:04:02 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GPSD".

The branch, master has been updated
       via  fd0055547841966d2b7815cc8ca515879a0ac1ae (commit)
      from  5b926e8abda5371eb2ea9e8b4aca5470e5358f73 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fd0055547841966d2b7815cc8ca515879a0ac1ae
Author: Stefan Roels <address@hidden>
Date:   Fri Oct 2 22:11:12 2015 -0400

    Fixup driver_ais from_sixbit parsing
    
    One of these problems has to do with the removal of spaces at the end of 
the six bits ascii strings. According to the documentation, the following steps 
should be taken:
    - Remove everything from the first @ sign (including the @ sign itself)
    - Strip trailing spaces from the result
    
    The existing code however fails to do so properly in certain circumstances.
    
    Consider the following scenarios (all assuming count = 20, e.g. type 5 
field shipname):
    1) The input string: "ALPHA @@@@@@@@@@@@@@" (single space before first @ 
character)
    The from_sixbit function will take i from 0 up to and including 6, where it 
will see the @ and break. to[6] will then be set to \0. Now the second part of 
the algorithm kicks in and starts at i=18. I could not find where the field was 
initialised, so I am not sure whether the field would be zero-filled, @ or 
space filled or random junk, but in any case either we find spaces or @ signs 
until we reach i=6, or we break at i>6. This would leave us with:
    "ALPHA \0..." The space at to[5] will not be cleared.
    2) The input string: "ALPHA BRAVO CHARLIE " (single space at the end)
    The from_sixbit function will take i from 0 up to and including 20, the 
break condition of the for loop will be met and we set to[20] to \0. At that 
moment we get to the second part of the algorithm which would look at to[18] 
which is 'E' and break without removing the trailing space.
    3) The input string: "ALPHA BRAVO CHARLI E" (space as character before the 
last one)
    The from_sixbit function will take i from 0 up to and including 20, the 
break condition of the for loop will be met and we set to[20] to \0. At that 
moment we get to the second part of the algorithm which would look at to[18] 
which is ' ' and will replace it with a \0, dropping the E at the end.
    
    Another spacing problem lies within the type 21 name/name extension field. 
If the name field would be trimmed, but there is data in the name extension 
field, the name extension would not be taken into account. Take for instance 
the following examples:
    name:"ALPHA BRAVO CHARLI E" name extension:"CHO" (assuming the incorrect 
space removal) result: "ALPHA BRAVO CHARLI" instead of "ALPHA BRAVO CHARLI ECHO"
    name:"ALPHA BRAVO CHARLIE " name extension:"DELTA" (assuming removal of the 
trailing space of name) result "ALPHA BRAVO CHARLIE" instead of "ALPHA BRAVO 
CHARLIE DELTA"
    
    I have created a patch to solve the problems mentioned above. You can find 
the patch and some examples of real world messages going wrong below.
    
    Best regards,
    Stefan Roels
    
    Added sample data from email and applied provided patch
    
    Signed-off-by: Jon Schlueter <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 driver_ais.c                          |   28 ++++++++++++++++++++++++----
 test/daemon/ais_unpack_sixbit.log     |   21 +++++++++++++++++++++
 test/daemon/ais_unpack_sixbit.log.chk |   32 ++++++++++++++++++++++++++++++++
 3 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 test/daemon/ais_unpack_sixbit.log
 create mode 100644 test/daemon/ais_unpack_sixbit.log.chk


hooks/post-receive
-- 
GPSD



reply via email to

[Prev in Thread] Current Thread [Next in Thread]