Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#4718 closed enhancement (fixed)

Coverity issues in cpukit/libfs/src/ftpfs/tftpDriver.c

Reported by: Frank Kuehndel Owned by: Sebastian Huber
Priority: lowest Milestone: 6.1
Component: fs Version: 6
Severity: trivial Keywords: coverity
Cc: Blocked By:
Blocking:

Description

Coverity indicates the following issues in cpukit/libfs/src/ftpfs/tftpDriver.c:

CID 1506523 (#1 of 1):

Unchecked return value from library (CHECKED_RETURN)

  1. check_return: Calling sendto(tp->socket, send_buf, plen, 0, (struct sockaddr *)&tp->farAddress, 16U) without checking return value. This library function may fail and return an error code.
727        sendto (
728            tp->socket,
729            send_buf,
730            plen,
731            0,
732            (struct sockaddr *) &tp->farAddress,
733            sizeof (tp->farAddress)
734        );

CID 1506522 (#1 of 1):

Unchecked return value from library (CHECKED_RETURN)

  1. check_return: Calling sendto(tp->socket, (char *)&msg, len, 0, (struct sockaddr *)to, 16U) without checking return value. This library function may fail and return an error code.
529    sendto (tp->socket, (char *)&msg, len, 0, (struct sockaddr *)to, sizeof *to);

CID 1437618 (#1 of 3):

Unchecked return value from library (CHECKED_RETURN)

  1. check_return: Calling setsockopt(tp->socket, 65535, 4102, &tv, 16U) without checking return value. This library function may fail and return an error code.
594        setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);

CID 1437618 (#2 of 3):

Unchecked return value from library (CHECKED_RETURN)

  1. check_return: Calling setsockopt(tp->socket, 65535, 4102, &tv, 16U) without checking return value. This library function may fail and return an error code.
555        setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);

CID 1437618 (#3 of 3):

Unchecked return value from library (CHECKED_RETURN)

  1. check_return: Calling setsockopt(tp->socket, 65535, 4102, &tv, 16U) without checking return value. This library function may fail and return an error code.
559        setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);

Change History (1)

comment:1 Changed on 12/02/22 at 15:18:54 by Frank Kühndel <frank.kuehndel@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"997ba1d905d91d62f23fee1fe43c7faa2c44a44b/rtems" 997ba1d9/rtems]:

tftpDriver.c: Fix Coverity issues

CID 1506523: Unchecked return value from library (CHECKED_RETURN)
CID 1506522: Unchecked return value from library (CHECKED_RETURN)
CID 1437618: Unchecked return value from library (CHECKED_RETURN)

Close #4718

Note: See TracTickets for help on using tickets.