Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Please extend the size of array fdesc #23

@ghost

Description

--- psm_utils.c.org 2018-02-23 20:46:51.999361301 -0500
+++ psm_utils.c 2018-02-23 20:47:24.048331778 -0500
@@ -955,7 +955,7 @@ psmi_faultinj_getspec(char *spec_name, i
union psmi_envvar_val env_fi;
char fvals_str[128];
char fname[128];

  •   char fdesc[256];
    
  •   char fdesc[512];
    
      snprintf(fvals_str, sizeof fvals_str - 1, "%d:%d:1", num, denom);
      fvals_str[sizeof fvals_str - 1] = '\0';
    

This dummy patch fix compiling issue with gcc-7. Please consider to apply it.

gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -Wall -Werror -fpic -fPIC -D_GNU_SOURCE -funwind-tables -O3 -g3 -DPSM_USE_SYS_UUID -Wno-strict-aliasing -DNVALGRIND -Wno-maybe-uninitialized -Wno-implicit-function-declaration -Wall -Werror -fpic -fPIC -D_GNU_SOURCE -funwind-tables -O3 -g3 -DPSM_USE_SYS_UUID -Wno-strict-aliasing -DNVALGRIND -Wno-maybe-uninitialized -Wno-implicit-function-declaration -I. -I/builddir/build/BUILD/infinipath-psm-3.3-22_g4abbc60_open/include -I/builddir/build/BUILD/infinipath-psm-3.3-22_g4abbc60_open/mpspawn -I/builddir/build/BUILD/infinipath-psm-3.3-22_g4abbc60_open/include/linux-x86_64 -c psm_utils.c -o psm_utils.o
psm_utils.c: In function 'psmi_faultinj_getspec':
psm_utils.c:964:57: error: '%s' directive output may be truncated writing up to 127 bytes into a region of size between 110 and 237 [-Werror=format-truncation=]
snprintf(fdesc, sizeof fdesc - 1, "Fault Injection %s <%s>",
^~
fname, fvals_str);
~~~~~~~~~
In file included from /usr/include/stdio.h:862,
from /builddir/build/BUILD/infinipath-psm-3.3-22_g4abbc60_open/include/ipath_udebug.h:37,
from /builddir/build/BUILD/infinipath-psm-3.3-22_g4abbc60_open/include/ipath_user.h:63,
from psm_user.h:45,
from psm_utils.c:36:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 20 and 274 bytes into a destination of size 255
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:282: psm_utils.o] Error 1
make[1]: Leaving directory '/builddir/build/BUILD/infinipath-psm-3.3-22_g4abbc60_open'
make: *** [Makefile:155: libs] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.HoNINL (%build)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions