Bug#805701: Clisp Patch

Flavio Cruz flaviocruz at gmail.com
Sun Dec 27 16:54:48 UTC 2015


On Sat, 21 Nov 2015 01:55:01 +0100 =?UTF-8?B?RmzDoXZpbyBDcnV6?= <flaviocruz at gmail.com> wrote:
> Dynamically allocate a path instead of using MAXPATHLEN.
> 
> --- clisp-2.49+hg.2015.05.31.orig/modules/syscalls/calls.c
> +++ clisp-2.49+hg.2015.05.31/modules/syscalls/calls.c
> @@ -5872,12 +5872,15 @@ void module__syscalls__init_function_2 (
>    /* if DATEMSK is not set, set it to the clisp-supplied value */
>    if (NULL == getenv("DATEMSK")) {
>      with_string_0(physical_namestring(GLO(lib_dir)),GLO(pathname_encoding),ldz,{
> -        char datemsk[MAXPATHLEN];
> +        /* use enough space for datemsk */
> +        const size_t datemsk_len = ldz_len + 1 + strlen("/syscalls/datemsk");
> +        char *datemsk = malloc(sizeof(char) * datemsk_len);
>          strcpy(datemsk,ldz);
>          if (ldz[ldz_len-1] == '/')
>            strcat(datemsk,"syscalls/datemsk");
>          else strcat(datemsk,"/syscalls/datemsk");
>          setenv("DATEMSK",datemsk,0);
> +        free(datemsk);
>        });
>    }
>  }



More information about the pkg-common-lisp-devel mailing list