Difference for socket/image.c from version 1.10 to 1.11


version 1.10 version 1.11
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_init_c =   * static char *rcsid_init_c =
  *    "$Id: image.c,v 1.10 2006/03/18 15:05:37 ryo_saeba Exp $";   *    "$Id: image.c,v 1.11 2006/05/21 10:35:10 akirschbaum Exp $";
  */   */
   
 /*  /*
Line 331
 
Line 331
  return;   return;
     }      }
   
     sl.buf = malloc(MAXSOCKBUF);      sl.buf = malloc(MAXSOCKSENDBUF);
     fallback = get_face_fallback(ns->faceset, face_num);      fallback = get_face_fallback(ns->faceset, face_num);
   
     if (facesets[fallback].faces[face_num].data == NULL) {      if (facesets[fallback].faces[face_num].data == NULL) {
Line 387
 
Line 387
     SockList sl;      SockList sl;
     int i;      int i;
   
     sl.buf = malloc(MAXSOCKBUF);      sl.buf = malloc(MAXSOCKSENDBUF);
   
     sprintf(sl.buf,"replyinfo image_info\n%d\n%d\n", nrofpixmaps-1, bmaps_checksum);      sprintf(sl.buf,"replyinfo image_info\n%d\n%d\n", nrofpixmaps-1, bmaps_checksum);
     for (i=0; i<MAX_FACE_SETS; i++) {      for (i=0; i<MAX_FACE_SETS; i++) {
Line 419
 
Line 419
     char *cp, buf[MAX_BUF];      char *cp, buf[MAX_BUF];
     SockList sl;      SockList sl;
   
     sl.buf = malloc(MAXSOCKBUF);      sl.buf = malloc(MAXSOCKSENDBUF);
   
     start = atoi(params);      start = atoi(params);
     for (cp = params; *cp != '\0'; cp++)      for (cp = params; *cp != '\0'; cp++)
Line 436
 
Line 436
     sl.len = strlen(sl.buf);      sl.len = strlen(sl.buf);
   
     for (i=start; i<=stop; i++) {      for (i=start; i<=stop; i++) {
    if (sl.len+2+4+1+1+strlen(new_faces[i].name)+1 > MAXSOCKSENDBUF) {
        LOG(llevError, "send_image_sums: buffer overflow, rejecting range %d..%d\n", start, stop);
        sprintf(buf, "replyinfo image_sums %d %d", start, stop);
        cs_write_string(ns, buf, strlen(buf));
        return;
    }
   
  SockList_AddShort(&sl, i);   SockList_AddShort(&sl, i);
  ns->faces_sent[i] |= NS_FACESENT_FACE;   ns->faces_sent[i] |= NS_FACESENT_FACE;
   
Line 449
 
Line 456
  sl.len += qq;   sl.len += qq;
  SockList_AddChar(&sl, 0);   SockList_AddChar(&sl, 0);
     }      }
     /* It would make more sense to catch this pre-emptively in the code above.  
      * however, if this really happens, we probably just want to cut down the  
      * size to less than 1000, since that is what we claim the protocol would  
      * support.  
      */  
     if (sl.len > MAXSOCKBUF) {  
  LOG(llevError,"send_image_send: buffer overrun, %d > %d\n", sl.len, MAXSOCKBUF);  
  abort();  
     }  
     Send_With_Handling(ns, &sl);      Send_With_Handling(ns, &sl);
     free(sl.buf);      free(sl.buf);
 }  }


Legend:
line(s) removed in v.1.10 
line(s) changed
 line(s) added in v.1.11

File made using version 1.98 of cvs2html by leaf at 2011-07-21 19:33