You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Lahiru Gunathilake (JIRA)" <ji...@apache.org> on 2008/01/04 05:35:34 UTC

[jira] Updated: (AXIS2C-867) Function axis2_svc_client_remove_all_headers[Alastair FETTES]

     [ https://issues.apache.org/jira/browse/AXIS2C-867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lahiru Gunathilake updated AXIS2C-867:
--------------------------------------

    Summary: Function axis2_svc_client_remove_all_headers[Alastair FETTES]  (was: Function axis2_svc_client_remove_all_headers)

> Function axis2_svc_client_remove_all_headers[Alastair FETTES]
> -------------------------------------------------------------
>
>                 Key: AXIS2C-867
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-867
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/clientapi
>    Affects Versions: Current (Nightly)
>         Environment: Ubuntu 7.04
>            Reporter: Lahiru Gunathilake
>             Fix For: Current (Nightly)
>
>         Attachments: diff.txt, diff2.txt
>
>
>  for (i = 0; i < size; i++)
>     {
>         /*axiom_node_t *node = NULL;                                                                                                                         
>            node = axutil_array_list_get(svc_client->headers, env, i);                                                                                        
>                                                                                                                                                              
>            if (node)                                                                                                                                         
>            {                                                                                                                                                 
>            axiom_node_free_tree(node, env);                                                                                                                  
>            node = NULL;                                                                                                                                      
>            } */
>         axutil_array_list_remove(svc_client->headers, env, i);
>     }
> AXIS2_EXTERN void *AXIS2_CALL
>  axutil_array_list_remove(
>      struct axutil_array_list *array_list,
>      const axutil_env_t * env,
>      int index)
>  {
>      void *result = NULL;
>      int i = 0;
>      AXIS2_PARAM_CHECK (env->error, array_list, AXIS2_FAILURE);
>      if (axutil_array_list_check_bound_exclusive(array_list, env, index))
>      {
>          result = array_list->data[index];
>          for (i = index; i < array_list->size - 1; i++)
>              array_list->data[i] = array_list->data[i + 1];
>         array_list->size--;
>      }
>      return result;
>  } There is a possible bug in "axis2_svc_client_remove_all_headers" function.  The call to "axutil_array_list_remove" is where the problem stems from.  Since the for-loop  is incrementing, and the value of "array_list->size"  is decrementing, eventually line 120 will fail, and some of the headers will not be cleared out.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org