]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use a signed integer for storing the number of bytes in the packet read from
authorRussell Bryant <russell@russellbryant.com>
Mon, 23 Jul 2007 12:25:01 +0000 (12:25 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 23 Jul 2007 12:25:01 +0000 (12:25 +0000)
the network.  Using an unsigned value here made it impossible to handle an
error returned from recvfrom().  Furthermore, in the case that recvfrom()
did return an error, this would cause a crash due to a heap overflow.
(closes issue #10265, reported by and fix suggested by timrobbins)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76485 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 57d084f5d31c5f284ccdb2b421c773ef56cd9748..41670080f3ca47496ccba7a9949777483fc82aca 100644 (file)
@@ -705,7 +705,7 @@ struct iax2_thread {
        struct sockaddr_in iosin;
        unsigned char readbuf[4096]; 
        unsigned char *buf;
-       size_t buf_len;
+       ssize_t buf_len;
        size_t buf_size;
        int iofd;
        time_t checktime;