[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#767588: RFS: 2048/1.0-3 [ITP] Simple number game for the text console



Hi,

A few remarks on the upstream part that handles $HOME and used to
crash (this is 008349f82, master at the moment)

> HOME = (char*)malloc(strlen(getenv("HOME")+1));
> HOME=getenv("HOME");
> SCOREFILE= (char*)malloc(strlen(HOME)+strlen(REL_SCOREFILE)+1);

  - the first line is useless, since HOME is reassigned after
  - this approach using strcat should work, but will fail if HOME is
    not set. In that case getenv will return NULL and strlen
    will dereference a null pointer (not tested).

Cheers

-- 
Etienne Millon


Reply to: