src/http/modules/ngx_http_index_module.c:176: error: Null Dereference
  pointer `name` last assigned on line 126 could be null and is dereferenced by call to `memcpy()` at line 176, column 13.

src/http/modules/ngx_http_index_module.c:96:1: start of procedure ngx_http_index_handler()
94.  */
95. 
96. static ngx_int_t
    ^
97. ngx_http_index_handler(ngx_http_request_t *r)
98. {

src/http/modules/ngx_http_index_module.c:112:9: Taking false branch
110.     ngx_http_script_len_code_pt   lcode;
111. 
112.     if (r->uri.data[r->uri.len - 1] != '/') {
             ^
113.         return NGX_DECLINED;
114.     }

src/http/modules/ngx_http_index_module.c:116:11: Taking false branch
114.     }
115. 
116.     if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
               ^
117.         return NGX_DECLINED;
118.     }

src/http/modules/ngx_http_index_module.c:120:5: 
118.     }
119. 
120.     ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module);
         ^
121.     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
122. 

src/http/modules/ngx_http_index_module.c:121:5: 
119. 
120.     ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module);
121.     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
         ^
122. 
123.     allocated = 0;

src/http/modules/ngx_http_index_module.c:123:5: 
121.     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
122. 
123.     allocated = 0;
         ^
124.     root = 0;
125.     dir_tested = 0;

src/http/modules/ngx_http_index_module.c:124:5: 
122. 
123.     allocated = 0;
124.     root = 0;
         ^
125.     dir_tested = 0;
126.     name = NULL;

src/http/modules/ngx_http_index_module.c:125:5: 
123.     allocated = 0;
124.     root = 0;
125.     dir_tested = 0;
         ^
126.     name = NULL;
127.     /* suppress MSVC warning */

src/http/modules/ngx_http_index_module.c:126:5: 
124.     root = 0;
125.     dir_tested = 0;
126.     name = NULL;
         ^
127.     /* suppress MSVC warning */
128.     path.data = NULL;

src/http/modules/ngx_http_index_module.c:128:5: 
126.     name = NULL;
127.     /* suppress MSVC warning */
128.     path.data = NULL;
         ^
129. 
130.     index = ilcf->indices->elts;

src/http/modules/ngx_http_index_module.c:130:5: 
128.     path.data = NULL;
129. 
130.     index = ilcf->indices->elts;
         ^
131.     for (i = 0; i < ilcf->indices->nelts; i++) {
132. 

src/http/modules/ngx_http_index_module.c:131:10: 
129. 
130.     index = ilcf->indices->elts;
131.     for (i = 0; i < ilcf->indices->nelts; i++) {
              ^
132. 
133.         if (index[i].lengths == NULL) {

src/http/modules/ngx_http_index_module.c:131:17: Loop condition is true. Entering loop body
129. 
130.     index = ilcf->indices->elts;
131.     for (i = 0; i < ilcf->indices->nelts; i++) {
                     ^
132. 
133.         if (index[i].lengths == NULL) {

src/http/modules/ngx_http_index_module.c:133:13: Taking true branch
131.     for (i = 0; i < ilcf->indices->nelts; i++) {
132. 
133.         if (index[i].lengths == NULL) {
                 ^
134. 
135.             if (index[i].name.data[0] == '/') {

src/http/modules/ngx_http_index_module.c:135:17: Taking false branch
133.         if (index[i].lengths == NULL) {
134. 
135.             if (index[i].name.data[0] == '/') {
                     ^
136.                 return ngx_http_internal_redirect(r, &index[i].name, &r->args);
137.             }

src/http/modules/ngx_http_index_module.c:139:13: 
137.             }
138. 
139.             reserve = ilcf->max_index_len;
                 ^
140.             len = index[i].name.len;
141. 

src/http/modules/ngx_http_index_module.c:140:13: 
138. 
139.             reserve = ilcf->max_index_len;
140.             len = index[i].name.len;
                 ^
141. 
142.         } else {

src/http/modules/ngx_http_index_module.c:162:13: Taking false branch
160.         }
161. 
162.         if (reserve > allocated) {
                 ^
163. 
164.             name = ngx_http_map_uri_to_path(r, &path, &root, reserve);

src/http/modules/ngx_http_index_module.c:172:13: Taking true branch
170.         }
171. 
172.         if (index[i].values == NULL) {
                 ^
173. 
174.             /* index[i].name.len includes the terminating '\0' */

src/http/modules/ngx_http_index_module.c:176:13: 
174.             /* index[i].name.len includes the terminating '\0' */
175. 
176.             ngx_memcpy(name, index[i].name.data, index[i].name.len);
                 ^
177. 
178.             path.len = (name + index[i].name.len - 1) - path.data;
