[FFmpeg-devel] rtmpproto compile error

Michael Niedermayer michaelni at gmx.at
Mon Nov 5 03:05:17 CET 2012


On Sun, Nov 04, 2012 at 11:51:01PM +0100, leon wrote:
> Hi all,
> 
> Somehow not triggered on the fate build machines, but with more or
> less latest revision i run into the following problem:
> 
> CC      libavformat/rtmpproto.o
> libavformat/rtmpproto.c: In function ârtmp_openâ:
> libavformat/rtmpproto.c:2188:9: error: implicit declaration of
> function âstrcat_is_forbidden_due_to_security_issues_use_av_strlcatâ
> [-Werror=implicit-function-declaration]
> make: *** [libavformat/rtmpproto.o] Error 1
> 
> Although the actual function used is 'strncat' and not 'strcat', it
> turns out that this include:
> 
> /usr/gcc4/lib/gcc/i686-pc-linux-gnu/4.7.2/include-fixed/bits/string2.h:774:0:
> 
> uses 'strcat', and hence triggers this issue.. :
> 
> /* Append no more than N characters from SRC onto DEST.  */
> #ifndef _HAVE_STRING_ARCH_strncat
> # ifdef _USE_STRING_ARCH_strchr
> #  define strncat(dest, src, n) \
>   (__extension__ ({ char *__dest = (dest);        \
>                     __builtin_constant_p (src) &&
> __builtin_constant_p (n)    \
>                     ? (strlen (src) < ((size_t) (n))        \
>                        ? strcat (__dest, src)        \
>                        : (*((char *) __mempcpy (strchr (__dest,
> '\0'),        \
>                                                 src, n)) = '\0',
> __dest))     \
>                     : strncat (dest, src, n); }))
> # else
> #  define strncat(dest, src, n) \
>   (__extension__ (__builtin_constant_p (src) && __builtin_constant_p
> (n)      \
>                   ? (strlen (src) < ((size_t) (n))        \
>                      ? strcat (dest, src)        \
>                      : strncat (dest, src, n))        \
>                   : strncat (dest, src, n)))
> # endif
> #endif
> 
> 
> 
> Any suggestions how to fix it?

I suggest to use av_strlcat instead

an alternative would be to move the anti strcat code from a #define
to a fate test or drop it entirely.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121105/d3096653/attachment.asc>


More information about the ffmpeg-devel mailing list