fix control flow if kill() command fails to end program

    Coverity:
    CID 739665 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
    At (17): "ifp->olsr_socket" is passed to a parameter that cannot be negative.

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
    fix wrong sizeof() parameter

    Coverity:

    CID 739610 (#1 of 1): Incorrect sizeof expression (BAD_SIZEOF)
    Taking the size of pointer parameter "lower_border_ip" is suspicious.

    CID 739611 (#1 of 1): Incorrect sizeof expression (BAD_SIZEOF)
    Taking the size of pointer parameter "upper_border_ip" is suspicious.

    CID 739692 (#1 of 2): Wrong sizeof argument (SIZEOF_MISMATCH)
    Passing argument "lower_border_ip" of type "union olsr_ip_addr *" and argument "8UL /* sizeof (lower_border_ip) */" to function "memset(void *, int, size_t)" is suspicious. Did you intend to use "sizeof(*lower_border_ip)" instead of "sizeof (lower_border_ip)" ?

    CID 739692 (#2 of 2): Wrong sizeof argument (SIZEOF_MISMATCH)
    Passing argument "upper_border_ip" of type "union olsr_ip_addr *" and argument "8UL /* sizeof (upper_border_ip) */" to function "memset(void *, int, size_t)" is suspicious. Did you intend to use "sizeof(*upper_border_ip)" instead of "sizeof (upper_border_ip)" ?

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
    Convert allocated memory into temporary variable

    Coverity:

    CID 739683 (#1 of 1): Resource leak (RESOURCE_LEAK)
    At (14): Variable "net_msg" going out of scope leaks the storage it points to.

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
    Protect against stupid data from ACPI

    Coverity:

    CID 739643 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
    At (29): In expression "bat_val * 100 / bat_max", division by expression "bat_max" which may be zero has undefined behavior.

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
    Close socket if bind() fails.

    Coverity:

    CID 739685 (#1 of 1): Resource leak (RESOURCE_LEAK)
    At (8): Handle variable "sock" going out of scope leaks the handle.

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
add a COVERITY instructions text file

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
pud: nmealib: fix invalid format string conversion

Coverity:
CID 739671 (#1 of 1): Printf format string issue (PW.BAD_PRINTF_FORMAT_STRING)
At (1): invalid format string conversion

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
pud: nmealib: fix invalid format string conversion

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
pud: fix closing fd

Coverity:
CID 739704 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
At (7): "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
pud: fix checking of downlink message IP version

Coverity:
CID 739637 (#1 of 1): Logically dead code (DEADCODE)
Execution cannot reach this expression ""false"" inside statement
"pudError(false, "Received w...".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
sgwdynspeed: fix resource leak and file stat/use race

Coverity:
CID 739680 (#1 of 1): Resource leak (RESOURCE_LEAK)
At (32): Variable "fd" going out of scope leaks the storage it points to.

CID 739697 (#1 of 1): Time of check time of use (TOCTOU)
At (1): Calling function "stat(char const * restrict,
                               struct stat * restrict)"
        to perform check on "fileName".
At (4): Calling function "fopen(char const * restrict,
                                char const * restrict)"
        that uses "fileName" after a check function. This can cause a
        time-of-check, time-of-use race condition.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Merge branch 'master' of http://olsr.org/git/olsrd
    Use strscpy instead of strncpy.

    Coverity:

    CID 739613 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (6): Calling strncpy with a maximum size argument of 16 bytes on destination array "t->if_name" of size 16 bytes might leave the destination string unterminated.

    CID 739614 (#1 of 3): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (4): Calling strncpy with a maximum size argument of 16 bytes on destination array "p4.name" of size 16 bytes might leave the destination string unterminated.

    CID 739614 (#2 of 3): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (4): Calling strncpy with a maximum size argument of 16 bytes on destination array "p6.name" of size 16 bytes might leave the destination string unterminated.

    CID 739614 (#3 of 3): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (5): Calling strncpy with a maximum size argument of 16 bytes on destination array "ifr.ifr_ifrn.ifrn_name" of size 16 bytes might leave the destination string unterminated.

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
    Check inet_pton return value

    Coverity:

    CID 739622 (#1 of 1): Unchecked return value (CHECKED_RETURN)
    At (8): Calling function "inet_pton(int, char const * restrict, void * restrict)" without checking return value (as is done elsewhere 22 out of 25 times).

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
    Close file descriptor if error happens

    Coverity:

    CID 739686 (#1 of 3): Resource leak (RESOURCE_LEAK)
    At (8): Handle variable "fd" going out of scope leaks the handle.

    CID 739686: Resource leak (RESOURCE_LEAK)
    At (12): Handle variable "fd" going out of scope leaks the handle.

    CID 739686: Resource leak (RESOURCE_LEAK)
    At (14): Handle variable "fd" going out of scope leaks the handle.

    Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
Fix scanf() format vulnerabilities
bmf: explicitly cast fgetc result into a char

Coverity:
CID 739615 (#1 of 1): Truncated stdio return value (CHAR_IO)
Assigning the return value of "fgetc(FILE *)" to char "EthTapSpoofState"
truncates its value.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
bmf: do not close an 'error' socket return value

Coverity:
CID 739657 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
At (12): "listeningSkfd" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
bmf: do not dereference NULL pointer

Coverity:
CID 739667 (#1 of 1): Dereference null return value (NULL_RETURNS)
At (31): Dereferencing a null pointer "bestIntf".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
httpinfo: do not close an 'error' socket return value

Coverity:
CID 739658 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
At (5): "client_socket" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>