ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/modules/yahoo2/libyahoo2 libyahoo2.c,1.10,1.1


From: Philip S Tellis <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/yahoo2/libyahoo2 libyahoo2.c,1.10,1.11
Date: Tue, 04 Mar 2003 00:33:47 -0500

Update of /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2
In directory subversions:/tmp/cvs-serv25872/modules/yahoo2/libyahoo2

Modified Files:
        libyahoo2.c 
Log Message:
fix read past end of buffer

Index: libyahoo2.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/libyahoo2.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- libyahoo2.c 7 Feb 2003 05:24:03 -0000       1.10
+++ libyahoo2.c 4 Mar 2003 05:33:44 -0000       1.11
@@ -1150,7 +1150,7 @@
 
        if(pkt->status == 0xffffffff) {
                YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 
login_status, url);
-               yahoo_logoff(yd->client_id);
+       /*      yahoo_logoff(yd->client_id);*/
        }
 }
 
@@ -1471,6 +1471,9 @@
        int pos = 0;
        int pktlen;
 
+       if(!yd)
+               return NULL;
+
        DEBUG_MSG(("rxlen is %d", yd->rxlen));
        if (yd->rxlen < YAHOO_PACKET_HDRLEN) {
                DEBUG_MSG(("len < YAHOO_PACKET_HDRLEN"));
@@ -1596,25 +1599,22 @@
        struct yab *yab = NULL;
        int pos = 0, end=0;
 
+       if(!yd)
+               return NULL;
+
        DEBUG_MSG(("rxlen is %d", yd->rxlen));
 
-       while(pos < yd->rxlen) {
-               if(yd->rxqueue[pos] == '<' && yd->rxqueue[pos+1] == 'r')
-                       break;
+       while(pos < yd->rxlen-1 && memcmp(yd->rxqueue + pos, "<r", 2))
                pos++;
-       }
 
-       if(pos >= yd->rxlen)
+       if(pos >= yd->rxlen-1)
                return NULL;
 
        end = pos+2;
-       while(end < yd->rxlen) {
-               if(yd->rxqueue[end] == '/' && yd->rxqueue[end+1] == '>')
-                       break;
+       while(end < yd->rxlen-1 && memcmp(yd->rxqueue + end, "/>", 2))
                end++;
-       }
 
-       if(end >= yd->rxlen)
+       if(end >= yd->rxlen-1)
                return NULL;
 
        yab = y_new0(struct yab, 1);
@@ -1645,8 +1645,9 @@
 static void yahoo_process_pager_connection(struct yahoo_data *yd)
 {
        struct yahoo_packet *pkt;
+       int id = yd->client_id;
 
-       while ((pkt = yahoo_getdata(yd)) != NULL) {
+       while (find_conn_by_id(id) && (pkt = yahoo_getdata(yd)) != NULL) {
 
                yahoo_packet_process(yd, pkt);
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]