#4291 closed defect (fixed)

main_help.c: Unchecked return value from library error spotted by Coverity

Reported by: Ryan Long Owned by: Ryan Long <ryan.long@…>
Priority: normal Milestone: 6.1
Component: lib Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

CID 1437650: Unchecked return value from library in rtems_shell_help().

472        strcpy(priv->prefix, "/dev/gr740_0");
473        priv->prefix[11] += dev->minor_drv;
   CID 1437630 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)2. check_return: Calling mkdir(priv->prefix, 511U) without checking return value. This library function may fail and return an error code. [Note: The source code implementation of the function has been overridden by a builtin model.]
474        mkdir(priv->prefix, S_IRWXU | S_IRWXG | S_IRWXO);
475        priv->prefix[12] = '/';
476        priv->prefix[13] = '\0';

Change History (5)

comment:1 Changed on 03/02/21 at 18:31:51 by Ryan Long

Accidentally put in the wrong reference to the error in the source.

121    if (lines && (line > lines)) {
   CID 1437650 (#2 of 2): Unchecked return value from library (CHECKED_RETURN)7. check_return: Calling getchar() without checking return value. This library function may fail and return an error code.
122      printf("Press any key to continue...");getchar();
123      printf("\n");

comment:2 Changed on 03/08/21 at 20:56:27 by Ryan Long <ryan.long@…>

Owner: set to Ryan Long <ryan.long@…>
Resolution: fixed
Status: newclosed

In fbab832/rtems:

main_help.c: Unchecked return value from library (CID #1437650)

CID 1437650: Unchecked return value from library in rtems_shell_help().

Closes #4291

comment:3 Changed on 03/10/21 at 17:49:17 by Ryan Long

Resolution: fixed
Status: closedreopened

comment:4 Changed on 03/30/21 at 15:11:17 by Ryan Long

Another issue was found at line 150 after submitting the first patch

150        printf("Press any key to continue...");
   CID 1437650 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)29. check_return: Calling getchar() without checking return value. This library function may fail and return an error code.
151        getchar();

comment:5 Changed on 05/28/21 at 17:29:48 by Ryan Long <ryan.long@…>

Resolution: fixed
Status: reopenedclosed

In 2deba02/rtems:

main_help.c: Do not care what char is returned by getchar()

CID 1437650: Unchecked return value from library in rtems_shell_help().

Closes #4291

Note: See TracTickets for help on using tickets.