version 1.10 | | version 1.11 |
---|
| | |
/* | | /* |
* 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 $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
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) { |
| | |
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++) { |
| | |
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++) |
| | |
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; |
| | |
| | |
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); |
} | | } |