• Status Closed
  • Percent Complete
  • Task Type Bugs
  • Category Games
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by daniel.weck - 2007-09-09
Last edited by jdgordon - 2008-08-19

FS#7740 - Chess:error in pl_malloc,missing update of remaining size in plugin buffer for pseudo dynamic alloc.

In chessbox_pgn.c, the bufleft variable is never updated to reflect the actual size left in the plugin buffer for pseudo dynamic allocation. The original code is:

/* global vars for pl_malloc() */
void *bufptr = NULL;
ssize_t bufleft;

/* simple function to “allocate” memory in pluginbuffer.
* (borrowed from dict.c)
void *pl_malloc(ssize_t size)

  void *ptr;
  ptr = bufptr;
  if (bufleft < size)
      return NULL;
      bufptr += size;
      return ptr;


/* init function for pl_malloc() */
void pl_malloc_init(void)

  bufptr = rb->plugin_get_buffer((size_t *)&bufleft);


In pl_malloc(), the bufleft variable should be updated as such:

      bufptr += size;
bufleft -= size;
      return ptr;

Closed by  jdgordon
2008-08-19 12:16
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

thanks :)

I forgot to say: this code is copied from dict.c, so the both the Chess and Dict plugins are affected by this.


Available keyboard shortcuts


Task Details

Task Editing