Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ngx_http_let_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ static char* ngx_http_let_let(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)

ngx_log_debug0(NGX_LOG_INFO, cf->log, 0, "let command handler");

if (value[1].len <= 1)
return "needs variable name";

if (value[1].data[0] != '$')
return "needs variable as the first argument";

Expand Down
22 changes: 22 additions & 0 deletions t/crash.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# vi:filetype=

use lib 'lib';
use Test::Nginx::Socket; # 'no_plan';

repeat_each(1);

plan tests => repeat_each() * 2 * blocks();

run_tests();

__DATA__

=== TEST 1: simple calc
--- config
location /let {
let $ a 1;
}
--- request
GET /let
--- error_log: directive needs variable name
--- must_die