Просмотр исходного кода

tentative fix for crash when orig->request_body is null

tags/v0.3
Brice Figureau 18 лет назад
Родитель
Сommit
76c26bbc60
1 измененных файлов: 2 добавлений и 2 удалений
  1. 2
    2
      ngx_http_uploadprogress_module.c

+ 2
- 2
ngx_http_uploadprogress_module.c Просмотреть файл

386
         }
386
         }
387
     }
387
     }
388
 
388
 
389
-    if (orig == NULL) {
389
+    if (orig == NULL || orig->request_body == NULL) {
390
         if (up != NULL && up->err_status != NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
390
         if (up != NULL && up->err_status != NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
391
             size = sizeof("new Object({ 'state' : 'done' })\r\n");
391
             size = sizeof("new Object({ 'state' : 'done' })\r\n");
392
         } else if (up != NULL && up->err_status == NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
392
         } else if (up != NULL && up->err_status == NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
411
     out.buf = b;
411
     out.buf = b;
412
     out.next = NULL;
412
     out.next = NULL;
413
 
413
 
414
-    if (orig == NULL) {
414
+    if (orig == NULL || orig->request_body == NULL ) {
415
         if (up == NULL) {
415
         if (up == NULL) {
416
             b->last = ngx_cpymem(b->last, "new Object({ 'state' : 'starting' })\r\n",
416
             b->last = ngx_cpymem(b->last, "new Object({ 'state' : 'starting' })\r\n",
417
                                  sizeof("new Object({ 'state' : 'starting' })\r\n") -
417
                                  sizeof("new Object({ 'state' : 'starting' })\r\n") -

Загрузка…
Отмена
Сохранить