OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.28k stars 583 forks source link

[BUG] build failure due to missing format strings in menuconfig/curses.c #2792

Closed loqs closed 2 years ago

loqs commented 2 years ago

OpenSIPS version you are running

OpenSIPS fails to build so I can not execute the command. The git source is f7722acf723f36b4fcccec8de890df57a45f4c7a

Describe the bug

The source fails to build due a printf format issue. To Reproduce

export CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
export CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
make
Generating parser
Generating lexer
Compiling action.c
Compiling async.c
Compiling bin_interface.c
Compiling blacklists.c
Compiling cfg_pp.c
Compiling cfg_reload.c
Compiling cmds.c
Compiling context.c
Compiling core_cmds.c
Compiling core_stats.c
Compiling crc.c
Compiling daemonize.c
Compiling data_lump.c
Compiling data_lump_rpl.c
Compiling dprint.c
Compiling dset.c
Compiling errinfo.c
Compiling error.c
Compiling flags.c
Compiling forward.c
Compiling globals.c
Compiling io_wait.c
Compiling ip_addr.c
Compiling ipc.c
New git revision: f7722acf7
Compiling main.c
Compiling map.c
Compiling md5.c
Compiling md5utils.c
Compiling mod_fix.c
Compiling modparam.c
Compiling msg_callbacks.c
Compiling msg_translator.c
Compiling name_alias.c
Compiling prime_hash.c
Compiling proxy.c
Compiling pt.c
Compiling pt_load.c
Compiling pt_scaling.c
Compiling pvar.c
Compiling qvalue.c
Compiling reactor.c
Compiling reactor_proc.c
Compiling re.c
Compiling receive.c
Compiling regexp.c
Compiling resolve.c
Compiling route.c
Compiling route_struct.c
Compiling script_cb.c
Compiling script_var.c
Compiling serialize.c
Compiling sha1.c
Compiling sha256.c
Compiling sha512.c
Compiling shutdown.c
Compiling signals.c
Compiling sl_cb.c
Compiling socket_info.c
Compiling sr_module.c
Compiling sr_module_deps.c
Compiling statistics.c
Compiling status_report.c
Compiling strcommon.c
Compiling timer.c
Compiling time_rec.c
Compiling trace_api.c
Compiling transformations.c
Compiling tsend.c
Compiling usr_avp.c
Compiling ut.c
Compiling xlog.c
Compiling mem/common.c
Compiling mem/f_malloc.c
Compiling mem/hp_malloc.c
Compiling mem/hp_malloc_stats.c
Compiling mem/mem.c
Compiling mem/mem_dbg_hash.c
Compiling mem/memtest.c
Compiling mem/module_info.c
Compiling mem/q_malloc.c
Compiling mem/rpm_mem.c
Compiling mem/shm_mem.c
Compiling aaa/aaa.c
Compiling parser/hf.c
Compiling parser/msg_parser.c
Compiling parser/parse_allow.c
Compiling parser/parse_authenticate.c
Compiling parser/parse_body.c
Compiling parser/parse_call_info.c
Compiling parser/parse_content.c
Compiling parser/parse_cseq.c
Compiling parser/parse_disposition.c
Compiling parser/parse_diversion.c
Compiling parser/parse_event.c
Compiling parser/parse_expires.c
Compiling parser/parse_fcaps.c
Compiling parser/parse_fline.c
Compiling parser/parse_from.c
Compiling parser/parse_hname2.c
Compiling parser/parse_list_hdr.c
Compiling parser/parse_methods.c
Compiling parser/parse_min_expires.c
Compiling parser/parse_nameaddr.c
Compiling parser/parse_pai.c
Compiling parser/parse_param.c
Compiling parser/parse_ppi.c
Compiling parser/parse_privacy.c
Compiling parser/parse_refer_to.c
Compiling parser/parse_replaces.c
Compiling parser/parser_f.c
Compiling parser/parse_rpid.c
Compiling parser/parse_rr.c
Compiling parser/parse_sipifmatch.c
Compiling parser/parse_sst.c
Compiling parser/parse_supported.c
Compiling parser/parse_to.c
Compiling parser/parse_uri.c
Compiling parser/parse_via.c
Compiling lib/cJSON.c
Compiling lib/csv.c
Compiling lib/hash.c
Compiling lib/path.c
Compiling lib/sliblist.c
Compiling lib/url.c
Compiling parser/digest/digest.c
Compiling parser/digest/digest_parser.c
Compiling parser/digest/param_parser.c
Compiling parser/sdp/sdp.c
Compiling parser/sdp/sdp_helpr_funcs.c
Compiling parser/contact/contact.c
Compiling parser/contact/parse_contact.c
Compiling db/db_async.c
Compiling db/db.c
Compiling db/db_id.c
Compiling db/db_insertq.c
Compiling db/db_pool.c
Compiling db/db_query.c
Compiling db/db_res.c
Compiling db/db_row.c
Compiling db/db_ut.c
Compiling mi/fmt.c
Compiling mi/item.c
Compiling mi/mi.c
Compiling mi/mi_core.c
Compiling mi/mi_trace.c
Compiling evi/event_interface.c
Compiling evi/evi_core.c
Compiling evi/evi_params.c
Compiling evi/evi_transport.c
Compiling cachedb/cachedb.c
Compiling cachedb/cachedb_dict.c
Compiling cachedb/cachedb_id.c
Compiling cachedb/cachedb_pool.c
Compiling cachedb/cachedb_types.c
Compiling net/net_tcp.c
Compiling net/net_tcp_proc.c
Compiling net/net_tcp_report.c
Compiling net/net_udp.c
Compiling net/tcp_common.c
Compiling net/tcp_passfd.c
Compiling net/trans.c
Compiling net/trans_trace.c
Compiling net/proto_tcp/proto_tcp.c
Compiling net/proto_udp/proto_udp.c
Compiling lex.yy.c
Compiling cfg.tab.c
Linking opensips
make install BASEDIR=/build/opensips/pkg
mkdir -m 700 -p /build/opensips/pkg/opensips/usr/local//etc/opensips/
mkdir -p /build/opensips/pkg/opensips/usr/local//sbin/
mkdir -p /build/opensips/pkg/opensips/usr/local//lib64/opensips/modules/
mkdir -p /build/opensips/pkg/opensips/usr/local//share/doc/opensips/
mkdir -p /build/opensips/pkg/opensips/usr/local//share/man//man8
mkdir -p /build/opensips/pkg/opensips/usr/local//share/man//man5
mkdir -p /build/opensips/pkg/opensips/usr/local//share/opensips/
sed -e "s#/usr/.*lib/opensips/modules/#/usr/local//lib64/opensips/modules/#g" \
        < etc/opensips.cfg > /build/opensips/pkg/opensips/usr/local//etc/opensips/opensips.cfg.sample0
umask 0077; sed -e "s#/usr/.*etc/opensips/tls/#/usr/local//etc/opensips/tls/#g" \
        < /build/opensips/pkg/opensips/usr/local//etc/opensips/opensips.cfg.sample0 \
        > /build/opensips/pkg/opensips/usr/local//etc/opensips/opensips.cfg.sample
rm -fr /build/opensips/pkg/opensips/usr/local//etc/opensips/opensips.cfg.sample0
if [ -z "" -a \
            ! -f /build/opensips/pkg/opensips/usr/local//etc/opensips/opensips.cfg ]; then \
        mv -f /build/opensips/pkg/opensips/usr/local//etc/opensips/opensips.cfg.sample \
            /build/opensips/pkg/opensips/usr/local//etc/opensips/opensips.cfg; \
    fi
make -C menuconfig proper
make[1]: Entering directory '/build/opensips/src/opensips/menuconfig'
rm -f configure
rm -f cfg.o curses.o items.o commands.o menus.o parser.o main.o
make[1]: Leaving directory '/build/opensips/src/opensips/menuconfig'
make -C menuconfig \
    MENUCONFIG_CFG_PATH=/usr/local//share/opensips//menuconfig_templates/ \
    MENUCONFIG_GEN_PATH=/usr/local//etc/opensips/ MENUCONFIG_HAVE_SOURCES=0
make[1]: Entering directory '/build/opensips/src/opensips/menuconfig'
gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -g -Wall -DMENUCONFIG_CFG_PATH=\"/usr/local//share/opensips//menuconfig_templates/\" -DMENUCONFIG_GEN_PATH=\"/usr/local//etc/opensips/\" -DMENUCONFIG_HAVE_SOURCES=0    -c -o cfg.o cfg.c
gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -g -Wall -DMENUCONFIG_CFG_PATH=\"/usr/local//share/opensips//menuconfig_templates/\" -DMENUCONFIG_GEN_PATH=\"/usr/local//etc/opensips/\" -DMENUCONFIG_HAVE_SOURCES=0    -c -o curses.o curses.c
curses.c: In function ‘draw_sibling_menu’:
curses.c:92:75: error: format not a string literal and no format arguments [-Werror=format-security]
   92 |         mvprintw(HIGH_NOTICE_Y,max_x/2-20,menu->parent?menu->parent->name:"OpenSIPS Main Configuration Menu");
      |                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
curses.c: In function ‘draw_item_list’:
curses.c:208:9: error: format not a string literal and no format arguments [-Werror=format-security]
  208 |         mvprintw(HIGH_NOTICE_Y,max_x/2-20,menu->name);
      |         ^~~~~~~~
curses.c:251:17: error: format not a string literal and no format arguments [-Werror=format-security]
  251 |                 print_notice(NOTICE_Y,NOTICE_X,0,current->description);
      |                 ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [<builtin>: curses.o] Error 1
make[1]: Leaving directory '/build/opensips/src/opensips/menuconfig'
make: *** [Makefile:485: opensipsmc] Error 2

Expected behavior

make install should complete without error. Relevant System Logs

OS/environment information

Additional context

github-actions[bot] commented 2 years ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

loqs commented 2 years ago

Fixed by #2821

github-actions[bot] commented 2 years ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

loqs commented 2 years ago

Fixed by 38242d6fe7491ea5de900e9ae45e3902edd1a67f