From: Aki Tuomi Date: Thu, 25 Oct 2018 10:50:36 +0000 (+0300) Subject: lib-lua: Use source instead of short_src X-Git-Tag: 2.3.4~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f56569b091f3b2f7fa0e8f08d17143f8e6659e8d;p=thirdparty%2Fdovecot%2Fcore.git lib-lua: Use source instead of short_src short_src is a limited value, and also an byte array instead of a pointer so it should not be returned. Found by coverity. --- diff --git a/src/lib-lua/dlua-dovecot.c b/src/lib-lua/dlua-dovecot.c index e80b40e752..2950489806 100644 --- a/src/lib-lua/dlua-dovecot.c +++ b/src/lib-lua/dlua-dovecot.c @@ -24,8 +24,10 @@ static void dlua_get_file_line(struct dlua_script *script, int arg, /* basename would be better, but basename needs memory allocation, since it might modify the buffer contents, so we use this which is good enough */ - if ((ptr = strrchr(ar.short_src, '/')) == NULL) - ptr = ar.short_src; + if (ar.source[0] != '@') + ptr = ""; + else if ((ptr = strrchr(ar.source, '/')) == NULL) + ptr = ar.source; else ptr++; *file_r = ptr;