axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mili...@apache.org
Subject svn commit: r650203 - /webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c
Date Mon, 21 Apr 2008 16:51:56 GMT
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


Mime
View raw message