[Libvirt-cim] [PATCH] [CU] Fix crash on invalid method name in std_invokemethod

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Jan 30 21:29:08 UTC 2008


Dan Smith wrote:
> # HG changeset patch
> # User Dan Smith <danms at us.ibm.com>
> # Date 1201714058 28800
> # Node ID 508066eaa4b4f521b7b5f959b9f0d2c4f1b810fe
> # Parent  fd28a485f90399d166eb62816c32e2d7727cced6
> [CU] Fix crash on invalid method name in std_invokemethod
> 
> I have no idea how this one slipped in, because it should always cause
> a crash if the method the client asks for isn't offered.
> 
> Signed-off-by: Dan Smith <danms at us.ibm.com>
> 
> diff -r fd28a485f903 -r 508066eaa4b4 std_invokemethod.c
> --- a/std_invokemethod.c	Wed Jan 16 07:43:41 2008 -0800
> +++ b/std_invokemethod.c	Wed Jan 30 09:27:38 2008 -0800
> @@ -92,7 +92,7 @@ CMPIStatus _std_invokemethod(CMPIMethodM
> 
>          CU_DEBUG("Method `%s' execution attempted", methodname);
> 
> -        for (hi = 0; ctx->handlers[hi]->name; hi++) {
> +        for (hi = 0; ctx->handlers[hi]; hi++) {
>                  if (STREQ(methodname, ctx->handlers[hi]->name)) {
>                          h = ctx->handlers[hi];
>                          break;

This is a good catch! +1

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list