[vlc-devel] [PATCH] Fix Hurd build

Rémi Denis-Courmont remi at remlab.net
Tue Apr 26 10:00:39 CEST 2016


Le 2016-04-26 02:58, Samuel Thibault a écrit :
> * The hurd also uses the .so extension for libraries.
> * theme_loader.cpp contains an unconditional use of PATH_MAX, which 
> is
> not defined on GNU/Hurd to avoid imposing build-time limits. This 
> change
> replaces its use with the same code used in src/posix/filesystem.c 
> for
> instance.
> ---
>  extras/analyser/zsh_completion.sh       | 2 +-
>  modules/gui/skins2/src/theme_loader.cpp | 5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/extras/analyser/zsh_completion.sh
> b/extras/analyser/zsh_completion.sh
> index a380a90..156b4d9 100755
> --- a/extras/analyser/zsh_completion.sh
> +++ b/extras/analyser/zsh_completion.sh
> @@ -11,7 +11,7 @@ case $HOST in
>      *cygwin*|*mingw*)
>          SUFFIX=dll
>      ;;
> -    *linux*|*bsd*)
> +    *linux*|*bsd*|*gnu*)
>          SUFFIX=so
>      ;;
>      *)

OK but should be distinct patch IMHO.

> diff --git a/modules/gui/skins2/src/theme_loader.cpp
> b/modules/gui/skins2/src/theme_loader.cpp
> index 1ec1dfc..64bd679 100644
> --- a/modules/gui/skins2/src/theme_loader.cpp
> +++ b/modules/gui/skins2/src/theme_loader.cpp
> @@ -549,7 +549,10 @@ int tar_extract_all( TAR *t, char *prefix )
>      union tar_buffer buffer;
>      int   len, err, getheader = 1, remaining = 0;
>      FILE  *outfile = NULL;
> -    char  fname[BLOCKSIZE + PATH_MAX];
> +
> +    long path_max = pathconf (".", _PC_PATH_MAX);
> +    size_t maxsize = (path_max == -1 || path_max > 4096) ? 4096 : 
> path_max;
> +    char  fname[BLOCKSIZE + maxsize];

Looks like we have a stack buffer overflow here, with or without the 
patch.

>
>      while( 1 )
>      {

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list