Hi

first, please dont forget to submit an application to outreachy theres
a deadline in a few hours


On Sun, Oct 16, 2016 at 04:28:23PM -0700, Thomas Turner wrote:
> Improved code coverage for libavcodec.
> Function(s) Tested: av_packet_clone().

It seems your mails get stuck in the moderation que
please make sure the address you use to send patches is subscribed
note, you can subscscribe multple addresses and set all but one to
nomail


[...]
> +static int IS_SPRINTF_ERR(int val, int tot_elem)
> +{
> +    int ret = 0;
> +    if(val > tot_elem){
> +        perror("overflow");
> +        ret = 1;
> +    }
> +    else if(val < 0){
> +        perror("sprintf");
> +        ret = 1;
> +    }
> +    if(ret > 0)
> +        return ret;
> +
> +    return ret;
> +}
> +
> +static void LOG_AVPACKET(AVPacket avpkt, const char* message)
> +{
> +    int val, tot_elem;
> +
> +    /* initialize array's */
> +    char buf_info[256]  = {0};
> +    char data_info[256] = {0};
> +    char side_info[256] = {0};
> +
> +    /* get buf information */
> +    if(avpkt.buf){
> +        val = sprintf(buf_info, "{buffer: %p,  data: %p, size: %d}",
> +            avpkt.buf->buffer, avpkt.buf->data, avpkt.buf->size);
> +        tot_elem = strlen(buf_info);
> +
> +        /** if sprintf error found */
> +        if(IS_SPRINTF_ERR(val, tot_elem))
> +            exit(-1);

iam not sure what this is doing  but you should just use snprintf()
instead of sprintf()
sprintf() is not "safe" as it doesnt check its output buffer size
its more a matter or principle, not that any specific case would
actually write over the array end

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to