]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 218933 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Wed, 16 Sep 2009 19:27:32 +0000 (19:27 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 16 Sep 2009 19:27:32 +0000 (19:27 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r218933 | mmichelson | 2009-09-16 14:25:36 -0500 (Wed, 16 Sep 2009) | 12 lines

  Reverse order of args to fread.

  This way, we don't always write a null byte into
  byte 1 of the buffer

  (closes issue #15905)
  Reported by: ebroad
  Patches:
        freadfix.patch uploaded by ebroad (license 878)
  Tested by: ebroad
........

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

channels/chan_sip.c

index a9f885175a45e9bfc901ced0e0e5555e8e5479a0..ff398b373fc15f086bac76860115f302af718f13 100644 (file)
@@ -2450,7 +2450,7 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi
                        while (cl > 0) {
                                size_t bytes_read;
                                ast_mutex_lock(&tcptls_session->lock);
-                               if (!(bytes_read = fread(buf, MIN(sizeof(buf) - 1, cl), 1, tcptls_session->f))) {
+                               if (!(bytes_read = fread(buf, 1, MIN(sizeof(buf) - 1, cl), tcptls_session->f))) {
                                        ast_mutex_unlock(&tcptls_session->lock);
                                        goto cleanup;
                                }