Skip to content

websocket.c:308:2: note: ‘snprintf’ output between 9 and 263 bytes into a destination of size 256 #88

@victor-shelepen

Description

@victor-shelepen

I am building the project from sources. During compilation I receive the following output:

[ 47%] Building C object CMakeFiles/signalwire_client.dir/src/transport/websocket.c.o
/usr/local/src/signalwire-c/src/transport/websocket.c: In function ‘__connect_socket’:
/usr/local/src/signalwire-c/src/transport/websocket.c:308:36: warning: ‘:swclt’ directive output may be truncated writing 6 bytes into a region of size between 0 and 254 [-Wformat-truncation=]
  308 |  snprintf(buf, sizeof(buf), "/%s:%s:swclt", ctx->info.path, ctx->info.address);
      |                                    ^~~~~~
/usr/local/src/signalwire-c/src/transport/websocket.c:308:2: note: ‘snprintf’ output between 9 and 263 bytes into a destination of size 256
  308 |  snprintf(buf, sizeof(buf), "/%s:%s:swclt", ctx->info.path, ctx->info.address);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 50%] Linking C shared library libsignalwire_client.so
[ 50%] Built target signalwire_client
Scanning dependencies of target swclt_bench
[ 52%] Building C object swclt_bench/CMakeFiles/swclt_bench.dir/main.c.o
[ 55%] Linking C executable swclt_bench
[ 55%] Built target swclt_bench
[ 57%] Generating C unity source swclt_test/cotire/swclt_test_C_unity.c
[ 60%] Generating C prefix source swclt_test/cotire/swclt_test_C_prefix.c
[ 63%] Generating C prefix header swclt_test/cotire/swclt_test_C_prefix.h
[ 65%] Building C precompiled header swclt_test/cotire/swclt_test_C_prefix.h.gch
Scanning dependencies of target swclt_test
[ 68%] Building C object swclt_test/CMakeFiles/swclt_test.dir/cases/callback.c.o
[ 71%] Building C object swclt_test/CMakeFiles/swclt_test.dir/cases/command.c.o

OS:

ubuntu@freeswitch:/usr/local/src/signalwire-c$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal

I go through the following tutorial: Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | Ubuntu 20.04 LTS

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