• Anton Khirnov's avatar
    lavf/ftp: check for truncation in snprintf · 7e29e027
    Anton Khirnov authored
    Silences e.g. the following warning in gcc 10:
    src/libavformat/ftp.c: In function ‘ftp_move’:
    src/libavformat/ftp.c:1122:46: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4091 [-Wformat-truncation=]
     1122 |     snprintf(command, sizeof(command), "RNTO %s\r\n", path);
          |                                              ^~       ~~~~
    src/libavformat/ftp.c:1122:5: note: ‘snprintf’ output between 8 and 4103 bytes into a destination of size 4096
     1122 |     snprintf(command, sizeof(command), "RNTO %s\r\n", path);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    7e29e027
ftp.c 33.5 KB