apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: apr/dso/os2 dso.c
Date Sun, 21 Oct 2001 03:48:15 GMT
bjh         01/10/20 20:48:15

  Modified:    dso/os2  dso.c
  Log:
  OS/2: Return a proper error code from apr_dso_sym() & prevent NULL dereference
  in apr_dso_error() if called after a failure in apr_dso_sym().
  
  Revision  Changes    Path
  1.24      +11 -5     apr/dso/os2/dso.c
  
  Index: dso.c
  ===================================================================
  RCS file: /home/cvs/apr/dso/os2/dso.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- dso.c	2001/04/25 05:26:39	1.23
  +++ dso.c	2001/10/21 03:48:15	1.24
  @@ -118,8 +118,10 @@
       if (symname == NULL || ressym == NULL)
           return APR_EINIT;
   
  -    if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0)
  -        return APR_EINIT;
  +    if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) {
  +        handle->load_error = APR_FROM_OS_ERROR(rc);
  +        return handle->load_error;
  +    }
   
       *ressym = func;
       return APR_SUCCESS;
  @@ -131,9 +133,13 @@
   {
       char message[200];
       apr_strerror(dso->load_error, message, sizeof(message));
  -    strcat(message, " (");
  -    strcat(message, dso->failed_module);
  -    strcat(message, ")");
  +
  +    if (dso->failed_module != NULL) {
  +        strcat(message, " (");
  +        strcat(message, dso->failed_module);
  +        strcat(message, ")");
  +    }
  +
       apr_cpystrn(buffer, message, buflen);
       return buffer;
   }
  
  
  

Mime
View raw message