Skip to content

array_map_op causes "Internal Server Error" #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cwells opened this issue Aug 17, 2010 · 3 comments
Closed

array_map_op causes "Internal Server Error" #1

cwells opened this issue Aug 17, 2010 · 3 comments

Comments

@cwells
Copy link

cwells commented Aug 17, 2010

The below config will cause "Internal Server Error" from Nginx 0.8.41:

location ~ ^/(?P<table>\w+)/(?P<id>\d+)/?$ {
    set_form_input    $columns;
    set_form_input    $values;
    array_split       ',' $values to=$array;
    array_map_op      set_quote_sql_str $array;
    array_join        ',' $array to=$sql_args;

    echo $sql_args;
}

Removing the array_map_op line allows it to complete successfully.

Test with:

curl -d "columns=username,password&values=joe,secret" http://localhost/users/1
@cwells
Copy link
Author

cwells commented Aug 17, 2010

I notice compatibility lists only up to 0.8.37, so I confirmed that the issue exists there as well.

@agentzh
Copy link
Member

agentzh commented Aug 18, 2010

This is a regression in recent versions of the ngx_set_misc module :P Thanks for the report!

I've just fixed it in ngx_set_misc v0.12 (git HEAD should work too):

http://github.com/agentzh/set-misc-nginx-module/tarball/v0.12

Could you give it a wheel?

Thanks again!
-agentzh

@cwells
Copy link
Author

cwells commented Aug 18, 2010

Looks like it's working now. Thanks for the quick fix!

zhuizhuhaomeng pushed a commit that referenced this issue May 23, 2022
568    dd("array var map: array size: %d", (int) array->nelts);
569
   CID 258181 (#1 of 1): Dereference null return value (NULL_RETURNS)7. dereference: Dereferencing array_it, which is known to be NULL.
570    array_it->not_found = 0;
571    array_it->valid = 1;
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants