brian       96/09/27 19:42:48

  Modified:    src       http_protocol.c
  Log:
  Reviewed by:  Brian Behlendorf
  Submitted by: Tom Tromey ([EMAIL PROTECTED])
  
  Fixes a core dump caused by failing to catch the lack of a properly-set
  HTTP error code in CGI responses.  Sets those to "500".
  
  Revision  Changes    Path
  1.50      +8 -2      apache/src/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_protocol.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -C3 -r1.49 -r1.50
  *** http_protocol.c   1996/09/28 02:35:53     1.49
  --- http_protocol.c   1996/09/28 02:42:46     1.50
  ***************
  *** 50,56 ****
     *
     */
      
  ! /* $Id: http_protocol.c,v 1.49 1996/09/28 02:35:53 brian Exp $ */
    
    /*
     * http_protocol.c --- routines which directly communicate with the
  --- 50,56 ----
     *
     */
      
  ! /* $Id: http_protocol.c,v 1.50 1996/09/28 02:42:46 brian Exp $ */
    
    /*
     * http_protocol.c --- routines which directly communicate with the
  ***************
  *** 1253,1258 ****
  --- 1253,1264 ----
        int idx = index_of_response (status);
        char *location = table_get (r->headers_out, "Location");
    
  +     /* If status code not found, use code 500.  */
  +     if (idx == -1) {
  +         status = SERVER_ERROR;
  +         idx = index_of_response (SERVER_ERROR);
  +     }
  + 
        if (!r->assbackwards) {
        int i;
        table *err_hdrs_arr = r->err_headers_out;
  ***************
  *** 1329,1335 ****
            bvputs(fd,"<HEAD><TITLE>", title, "</TITLE></HEAD>\n<BODY><H1>", 
title,
               "</H1>\n", NULL);
        
  !         switch (r->status) {
        case REDIRECT:
        case MOVED:
            bvputs(fd, "The document has moved <A HREF=\"",
  --- 1335,1341 ----
            bvputs(fd,"<HEAD><TITLE>", title, "</TITLE></HEAD>\n<BODY><H1>", 
title,
               "</H1>\n", NULL);
        
  !         switch (status) {
        case REDIRECT:
        case MOVED:
            bvputs(fd, "The document has moved <A HREF=\"",
  
  
  

Reply via email to