~ubuntu-branches/ubuntu/saucy/trousers/saucy

« back to all changes in this revision

Viewing changes to src/tspi/rpc/tcstp/rpc.c

  • Committer: Package Import Robot
  • Author(s): Pierre Chifflier
  • Date: 2012-06-18 22:22:21 UTC
  • mfrom: (0.1.22 sid)
  • Revision ID: package-import@ubuntu.com-20120618222221-kumdab5nrfx4kvyh
Tags: 0.3.9-1
* Imported Upstream version 0.3.9
* Refreshed Debian patches
* Removed patch 04-gcc46.patch, not required anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
        offset = 0;
124
124
        if ((result = loadData(&offset, dataType, theData, theDataSize, NULL)))
125
125
                return result;
126
 
        if (((int)comm->hdr.packet_size + (int)offset) < 0) {
 
126
        if ((comm->hdr.packet_size + offset) > TSS_TPM_TXBLOB_SIZE) {
127
127
                LogError("Too much data to be transmitted!");
128
128
                return TSPERR(TSS_E_INTERNAL_ERROR);
129
129
        }
130
 
        if (((int)comm->hdr.packet_size + (int)offset) > comm->buf_size) {
 
130
        if ((comm->hdr.packet_size + offset) > comm->buf_size) {
131
131
                /* reallocate the buffer */
132
132
                BYTE *buffer;
133
133
                int buffer_size = comm->hdr.packet_size + offset;
389
389
 
390
390
        buffer = hte->comm.buf;
391
391
        recv_size = sizeof(struct tcsd_packet_hdr);
392
 
        if ((recv_size = recv_from_socket(sd, buffer, recv_size)) < 0) {
 
392
        if (recv_from_socket(sd, buffer, recv_size) < 0) {
393
393
                result = TSPERR(TSS_E_COMM_FAILURE);
394
394
                goto err_exit;
395
395
        }
404
404
                goto err_exit;
405
405
        }
406
406
 
407
 
        if (recv_size > hte->comm.buf_size ) {
 
407
        if (recv_size > (int) hte->comm.buf_size ) {
408
408
                BYTE *new_buffer;
409
409
 
410
410
                LogDebug("Increasing communication buffer to %d bytes.", recv_size);
421
421
 
422
422
        /* get the rest of the packet */
423
423
        recv_size -= sizeof(struct tcsd_packet_hdr);    /* already received the header */
424
 
        if ((recv_size = recv_from_socket(sd, buffer, recv_size)) < 0) {
 
424
        if (recv_from_socket(sd, buffer, recv_size) < 0) {
425
425
                result = TSPERR(TSS_E_COMM_FAILURE);
426
426
                goto err_exit;
427
427
        }
464
464
                goto err_exit;
465
465
        }
466
466
 
467
 
        if (recv_size > hte->comm.buf_size ) {
 
467
        if (recv_size > (int) hte->comm.buf_size ) {
468
468
                BYTE *new_buffer;
469
469
 
470
470
                LogDebug("Increasing communication buffer to %d bytes.", recv_size);