You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by mi...@apache.org on 2008/04/21 18:51:56 UTC

svn commit: r650203 - /webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c

Author: milinda
Date: Mon Apr 21 09:51:47 2008
New Revision: 650203

URL: http://svn.apache.org/viewvc?rev=650203&view=rev
Log:
Fixed invalid memory read at guthtila_xml_parser.c line 1553, inside guththila_nex_char function.

Modified:
    webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c

Modified: webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c?rev=650203&r1=650202&r2=650203&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c Mon Apr 21 09:51:47 2008
@@ -1550,20 +1550,19 @@
     else if (m->reader->type == GUTHTHILA_IO_READER ||
              m->reader->type == GUTHTHILA_FILE_READER)
     {
-        if (m->next <
-             GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) +
-             GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer) &&
-             m->buffer.cur_buff != -1)
+        
+        if ( m->buffer.cur_buff != -1 && 
+             m->next < GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) +
+             GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer))
         {
             c = m->buffer.buff[m->buffer.cur_buff][m->next++ -
                                                     GUTHTHILA_BUFFER_PRE_DATA_SIZE
                                                     (m->buffer)];
             return c >= 0 ? c : -1;
         }
-        else if (m->next >=
-                 GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) +
-                 GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer) &&
-                 m->buffer.cur_buff != -1)
+        else if ( m->buffer.cur_buff != -1 &&
+                  m->next >= GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) +
+                  GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer))
         {
             /* We are sure that the difference lies within the int range */
             if (m->buffer.cur_buff == (int)m->buffer.no_buffers - 1)



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org