Skip to content

lgtm issue #320

@avan989

Description

@avan989

Describe the bug

os-impl-bsd-sockets.c

line 217, 568:
if (addrlen == 0 \|\| addrlen > OS_SOCKADDR_MAX_LEN)
--
  | Comparison is always false because addrlen <= 28.

line 574:
Accessor->sockaddr.sa_family = sa_family;
--
  | The variable sa_family may not be initialized here.

os-impl-posix-files.c

line 240:

if ( chmod(local_path, st.st_mode) < 0 )
--
  | The filename being operated upon was previously checked, but the underlying file may have been changed since then.

posix/osfileapi.c

line 186:
execl(shell, "sh", "-c", Cmd, NULL); /* does not return if successful */
--
  | The value of this argument may come from call to getenv and is being passed to execl

shared/osapi-idmap.c

line 529:
return_code = OS_ObjectIdMap(idtype, idvalue, &obj->active_id);
--
  | The variable obj may not be initialized here.

line: 545
*array_index = local_id;
--
  | The variable local_id may not be initialized here.

line 549:
*record = obj;
--
  | The variable obj may not be initialized here.

shared/osapi-sockets.c

return_code = OS_SocketAccept_Impl(local_id, conn_id, Addr, timeout);
--
  | The variable conn_id may not be initialized here.

shared/osapi-time.c

line 466:
OS_ObjectIdRefcountDecr(timebase);
--
  | The variable timebase may not be initialized here.

os-posix.h

This header file should contain a header guard to prevent multiple inclusion.

osapi-filesys.c

line 330:
OS_FileSysStopVolume_Impl(local_id);
--
  | This expression has no effect (because OS_FileSysStopVolume_Impl has no external side effects).

To Reproduce
Steps to reproduce the behavior:

  1. Run against lgtm

Reporter Info
Anh Van, NASA Goddard

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions