diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-06-25 16:49:53 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-06-25 16:49:53 +0000 |
commit | 42b784ac1a0c71e7d494db68ff700101461f840f (patch) | |
tree | 5f64d2b91ff78cbb9454456f0b9203faf1812d7e /configure | |
parent | 80f2b9c5a68d9899965fc30001807cd827ca4174 (diff) | |
download | mpv-42b784ac1a0c71e7d494db68ff700101461f840f.tar.bz2 mpv-42b784ac1a0c71e7d494db68ff700101461f840f.tar.xz |
string handling security fixes
patch by Nicholas Kain, Alexander Strasser <eclipse7@gmx.net>
reviewed by Pontscho, Alex, Rich
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12647 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -2712,6 +2712,34 @@ else fi echores "$_strsep" +echocheck "strlcpy()" +cat > $TMPC << EOF +#include <string.h> +int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; } +EOF +_strlcpy=no +cc_check && _strlcpy=yes +if test "$_strlcpy" = yes ; then + _def_strlcpy='#define HAVE_STRLCPY 1' +else + _def_strlcpy='#undef HAVE_STRLCPY' +fi +echores "$_strlcpy" + +echocheck "strlcat()" +cat > $TMPC << EOF +#include <string.h> +int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; } +EOF +_strlcat=no +cc_check && _strlcat=yes +if test "$_strlcat" = yes ; then + _def_strlcat='#define HAVE_STRLCAT 1' +else + _def_strlcat='#undef HAVE_STRLCAT' +fi +echores "$_strlcat" + echocheck "fseeko()" cat > $TMPC << EOF #include <stdio.h> @@ -6336,6 +6364,18 @@ $_def_scandir /* Define this if your system has strsep */ $_def_strsep +/* Define this if your system has strlcpy */ +$_def_strlcpy +#ifndef HAVE_STRLCPY +unsigned int strlcpy (char *dest, char *src, unsigned int size); +#endif + +/* Define this if your system has strlcat */ +$_def_strlcat +#ifndef HAVE_STRLCAT +unsigned int strlcat (char *dest, char *src, unsigned int size); +#endif + /* Define this if your system has fseeko */ $_def_fseeko #ifndef HAVE_FSEEKO |