Skip to content

Compile error in wsman-soap.c #207

Description

@udosteinberg

Compiling the latest release (2.8.1) with a recent gcc results in the following compile error:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -O2 -fPIC -m64 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wunused -Werror -DPACKAGE_PLUGIN_DIR=\"/usr/lib64/openwsman/plugins\" -I../.. -I../../include -I/usr/include/libxml2 -O2 -fPIC -m64 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wunused -Werror -MT wsman-soap.lo -MD -MP -MF .deps/wsman-soap.Tpo -c wsman-soap.c  -fPIC -DPIC -o .libs/wsman-soap.o
In function 'create_subs_info',
    inlined from 'wse_subscribe_stub' at wsman-soap.c:1864:8:
wsman-soap.c:1812:17: error: 'strncpy' specified bound 64 equals destination size [-Werror=stringop-truncation]
 1812 |                 strncpy(subsInfo->subsId, ntext, EUIDLEN);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

This says the destination might not be null-terminated if the source is EUIDLEN bytes long. If null-termination is guaranteed through some other means, then the warning should be disabled.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions