X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffserver.c;h=e83534cc764da5be1cea6815fc27ed6b3e53e65e;hb=db9f426caba574719c58de12e68742063c8e7979;hp=bab40a327506a232683425196ae77fe9a1bf578c;hpb=378a5b9c5f1a8b51dee3b954713d18f330fbb027;p=ffmpeg diff --git a/ffserver.c b/ffserver.c index bab40a32750..e83534cc764 100644 --- a/ffserver.c +++ b/ffserver.c @@ -333,7 +333,8 @@ static int64_t ffm_read_write_index(int fd) { uint8_t buf[8]; - lseek(fd, 8, SEEK_SET); + if (lseek(fd, 8, SEEK_SET) < 0) + return AVERROR(EIO); if (read(fd, buf, 8) != 8) return AVERROR(EIO); return AV_RB64(buf); @@ -800,7 +801,7 @@ static void http_send_too_busy_reply(int fd) "\r\n" "Too busy\r\n" "

The server is too busy to serve your request at this time.

\r\n" - "

The number of current connections is %d, and this exceeds the limit of %d.

\r\n" + "

The number of current connections is %u, and this exceeds the limit of %u.

\r\n" "\r\n", nb_connections, nb_max_connections); av_assert0(len < sizeof(buffer)); @@ -811,7 +812,8 @@ static void http_send_too_busy_reply(int fd) static void new_connection(int server_fd, int is_rtsp) { struct sockaddr_in from_addr; - int fd, len; + socklen_t len; + int fd; HTTPContext *c = NULL; len = sizeof(from_addr); @@ -1735,7 +1737,8 @@ static int http_parse_request(HTTPContext *c) case REDIR_SDP: { uint8_t *sdp_data; - int sdp_data_size, len; + int sdp_data_size; + socklen_t len; struct sockaddr_in my_addr; snprintf(q, c->buffer_size, @@ -3018,7 +3021,8 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url) char path1[1024]; const char *path; uint8_t *content; - int content_length, len; + int content_length; + socklen_t len; struct sockaddr_in my_addr; /* find which url is asked */