mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-03 13:04:37 +03:00
Cosmetics: address cppcheck warnings
This commit is contained in:
@@ -39,7 +39,7 @@ namespace modsecurity {
|
||||
namespace engine {
|
||||
|
||||
|
||||
bool Lua::isCompatible(std::string script, Lua *l, std::string *error) {
|
||||
bool Lua::isCompatible(const std::string &script, Lua *l, std::string *error) {
|
||||
#ifdef WITH_LUA
|
||||
std::string lua(".lua");
|
||||
std::string err;
|
||||
@@ -63,7 +63,7 @@ bool Lua::isCompatible(std::string script, Lua *l, std::string *error) {
|
||||
}
|
||||
|
||||
|
||||
bool Lua::load(std::string script, std::string *err) {
|
||||
bool Lua::load(const std::string &script, std::string *err) {
|
||||
#ifdef WITH_LUA
|
||||
lua_State *L = NULL;
|
||||
L = luaL_newstate();
|
||||
|
@@ -53,7 +53,7 @@ class LuaScriptBlob {
|
||||
}
|
||||
|
||||
|
||||
const char *read(size_t *len) {
|
||||
const char *read(size_t *len) const {
|
||||
*len = m_len;
|
||||
return (const char *)m_data;
|
||||
}
|
||||
@@ -68,9 +68,9 @@ class Lua {
|
||||
public:
|
||||
Lua() { }
|
||||
|
||||
bool load(std::string script, std::string *err);
|
||||
bool load(const std::string &script, std::string *err);
|
||||
int run(Transaction *t, const std::string &str="");
|
||||
static bool isCompatible(std::string script, Lua *l, std::string *error);
|
||||
static bool isCompatible(const std::string &script, Lua *l, std::string *error);
|
||||
|
||||
#ifdef WITH_LUA
|
||||
static int blob_keeper(lua_State *L, const void *p, size_t sz, void *ud);
|
||||
|
Reference in New Issue
Block a user