[Xotcl] Memory trash in 0.9.3 and 0.9.4

Zoran Vasiljevic zoran at archiware.com
Mon Mar 4 12:15:37 CET 2002


In file xotcl.c:

static int
XOTclCNewMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj *objv[]) {
  XOTclClass *cl = XOTclObjectToClass(cd);
  XOTclObject *obj = &cl->object;
  Tcl_Obj *cname, *autoname;
  char *name, *n;
  int result, offset=1;
  DEFINE_NEW_TCL_OBJECTS_ON_STACK(objc+1, ov);

  /*                              ^^^^^^  */
   
Should read:

  DEFINE_NEW_TCL_OBJECTS_ON_STACK(objc+2, ov);

... because later in file, ov[0] and ov[1] are 
reserved for internal use and other arguments
are copied over which results in trashing memory.

Cheers
Zoran



More information about the Xotcl mailing list