httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Plüm, Rüdiger, VF-Group" <ruediger.pl...@vodafone.com>
Subject RE: ap_log_error wants a string literal in mod_lua
Date Wed, 05 Oct 2011 14:54:27 GMT
 

> -----Original Message-----
> From: Igor Galić [mailto:i.galic@brainsware.org] 
> Sent: Mittwoch, 5. Oktober 2011 16:51
> To: dev 
> Subject: ap_log_error wants a string literal in mod_lua
> 
> 
> Hey folks,
> 
> When trunk with (hardened) gcc 4.6 on Ubuntu beta, I get:
> 
> lua_config.c: In function 'cmd_log_at':
> lua_config.c:177:5: error: format not a string literal and no 
> format arguments [-Werror=format-security]
> cc1: some warnings being treated as errors
> 
> 
> The appropriate source:
>     lua_Debug dbg;
>     
>     lua_getstack(L, 1, &dbg);
>     lua_getinfo(L, "Sl", &dbg);
>     
>     msg = luaL_checkstring(L, 2);
>     ap_log_error(dbg.source, dbg.currentline, 
> APLOG_MODULE_INDEX, level, 0, cmd->server, msg);
> 
> 
> Is there anything we can do to fix this so it builds again 
> with paranoia options?

How about:

ap_log_error(dbg.source, dbg.currentline, APLOG_MODULE_INDEX, level, 0, cmd->server, "%s",
msg);

Regards

Rüdiger


Mime
View raw message