[Cbe-oss-dev] [PATCH 3/3] libspe2: Fix incorrect translation of NULL parameter by C99 perror handler

Kazunori Asayama asayama at sm.sony.co.jp
Tue Apr 10 23:45:42 EST 2007


The current perror handler implementation doesn't handle NULL as
special meaning, and it causes invalid memory access. This patch fix
the problem.

Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>

Index: libspe2-public/spebase/default_c99_handler.c
===================================================================
--- libspe2-public.orig/spebase/default_c99_handler.c
+++ libspe2-public/spebase/default_c99_handler.c
@@ -1928,7 +1928,7 @@ int default_c99_handler_perror(char *ls,
 
     DEBUG_PRINTF("%s\n", __func__);
     CHECK_C99_OPCODE(PERROR);
-    s = GET_LS_PTR(arg0->slot[0]);
+    s = GET_LS_PTR_NULL(arg0->slot[0]);
     perror(s);
     return 0;
 }



More information about the cbe-oss-dev mailing list