Explorar el Código

[Minor] Fix the case when filename is empty for an image

Issue: #2818
Closes: #2818
tags/1.9.1
Vsevolod Stakhov hace 5 años
padre
commit
266e842936
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7
    2
      src/lua/lua_task.c

+ 7
- 2
src/lua/lua_task.c Ver fichero

@@ -5653,8 +5653,13 @@ lua_image_get_filename (lua_State *L)
LUA_TRACE_POINT;
struct rspamd_image *img = lua_check_image (L);

if (img != NULL && img->filename != NULL) {
lua_pushlstring (L, img->filename->begin, img->filename->len);
if (img != NULL) {
if (img->filename != NULL) {
lua_pushlstring (L, img->filename->begin, img->filename->len);
}
else {
lua_pushnil (L);
}
}
else {
return luaL_error (L, "invalid arguments");

Cargando…
Cancelar
Guardar