• Ludovic Rousseau's avatar
    Fix compiler warning: output may be truncated · eaaf8eda
    Ludovic Rousseau authored
    winscard_msg.c: In function ‘ClientSetupSession’:
    winscard_msg.c:134:2: warning: ‘strncpy’ output may be truncated copying 108 bytes from a string of length 109 [-Wstringop-truncation]
      strncpy(svc_addr.sun_path, socketName, sizeof(svc_addr.sun_path));
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    The source was sizeof(struct sockaddr_un) bytes long.
    But the destination was sizeof(svc_addr.sun_path) bytes long only.
    
    svc_addr is a struct sockaddr_un but the sun_path field is shorter (1
    byte shorter according to the compiler) than the complete struct
    sockaddr_un.
    eaaf8eda
Name
Last commit
Last update
UnitaryTests Loading commit data...
doc Loading commit data...
etc Loading commit data...
m4 Loading commit data...
src Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
GPL-3.0.txt Loading commit data...
HELP Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
README.md Loading commit data...
SECURITY Loading commit data...
TODO Loading commit data...
bootstrap Loading commit data...
c.sh Loading commit data...
clang-analyze.sh Loading commit data...
configure.ac Loading commit data...
splint.sh Loading commit data...
stamp-h.in Loading commit data...