Fix a possible stack corruption
authorSteven Barth <steven@midlink.org>
Mon, 16 Mar 2009 13:34:46 +0000 (13:34 +0000)
committerSteven Barth <steven@midlink.org>
Mon, 16 Mar 2009 13:34:46 +0000 (13:34 +0000)
libs/nixio/src/syslog.c

index 081e836..b3d87e2 100644 (file)
@@ -82,7 +82,7 @@ static int nixio__syslogmasg(lua_State *L, int dolog) {
 
        if (dolog) {
                const char *msg = luaL_checkstring(L, 2);
 
        if (dolog) {
                const char *msg = luaL_checkstring(L, 2);
-               syslog(priority, msg);
+               syslog(priority, "%s", msg);
        } else {
                setlogmask(LOG_UPTO(priority));
        }
        } else {
                setlogmask(LOG_UPTO(priority));
        }