… | |
… | |
467 | { |
467 | { |
468 | ns->faces_sent[i] |= NS_FACESENT_FACE; |
468 | ns->faces_sent[i] |= NS_FACESENT_FACE; |
469 | |
469 | |
470 | int qq = get_face_fallback (ns->faceset, i); |
470 | int qq = get_face_fallback (ns->faceset, i); |
471 | |
471 | |
|
|
472 | if (sl.room () < 2 + 4 + 1 + new_faces[i].name.length () + 1) |
|
|
473 | break; |
|
|
474 | |
472 | sl << uint16 (i) |
475 | sl << uint16 (i) |
473 | << uint32 (facesets[qq].faces[i].checksum) |
476 | << uint32 (facesets[qq].faces[i].checksum) |
474 | << uint8 (qq) |
477 | << uint8 (qq) |
475 | << data8 (&new_faces[i].name, new_faces[i].name.length () + 1); |
478 | << data8 (&new_faces[i].name, new_faces[i].name.length () + 1); |
476 | } |
479 | } |
… | |
… | |
478 | /* It would make more sense to catch this pre-emptively in the code above. |
481 | /* It would make more sense to catch this pre-emptively in the code above. |
479 | * however, if this really happens, we probably just want to cut down the |
482 | * however, if this really happens, we probably just want to cut down the |
480 | * size to less than 1000, since that is what we claim the protocol would |
483 | * size to less than 1000, since that is what we claim the protocol would |
481 | * support. |
484 | * support. |
482 | */ |
485 | */ |
|
|
486 | //TODO: taken care of above, should simply abort or make sure the above code is correct |
483 | if (sl.length () >= MAXSOCKBUF) |
487 | if (sl.length () >= MAXSOCKBUF) |
484 | { |
488 | { |
485 | LOG (llevError, "send_image_send: buffer overrun, %d > %d\n", sl.length (), MAXSOCKBUF); |
489 | LOG (llevError, "send_image_send: buffer overrun, %d > %d\n", sl.length (), MAXSOCKBUF); |
486 | abort (); |
490 | abort (); |
487 | } |
491 | } |