Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gnome-keyring
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 88
    • Issues 88
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gnome-keyring
  • Merge requests
  • !52

pkcs11: Don't use strncpy when copying paths

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Matt Turner requested to merge mattst88/gnome-keyring:no-strncpy into master May 22, 2022
  • Overview 2
  • Commits 1
  • Pipelines 2
  • Changes 2

Using strncpy produces the following warning, which indicates that the destination string could be left unterminated.

  CC       daemon/control/gkd-control-server.lo
  CCLD     libgkd-control.la
  CC       pkcs11/rpc-layer/libgkm_rpc_layer_la-gkm-rpc-dispatch.lo
In file included from /usr/include/string.h:519,
                 from /usr/include/glib-2.0/glib/galloca.h:33,
                 from /usr/include/glib-2.0/glib.h:30,
                 from ./egg/egg-error.h:24,
                 from pkcs11/rpc-layer/gkm-rpc-dispatch.c:31:
In function ‘strncpy’,
    inlined from ‘gkm_rpc_layer_startup’ at pkcs11/rpc-layer/gkm-rpc-dispatch.c:2382:2:
/usr/include/bits/string_fortified.h:95:10: warning: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: no-strncpy