Ticket #136: openct-strict-aliasing.patch

File openct-strict-aliasing.patch, 0.7 KB (added by Stanislav Brabec, 21 months ago)

openct-strict-aliasing.patch

  • src/ifd/process.c

    process.c: In function 'do_memory_read':
    process.c:456: warning: dereferencing type-punned pointer will break strict-aliasing rules
    ================================================================================
     
    445445                   ct_tlv_builder_t * resp) 
    446446{ 
    447447        unsigned char data[CT_SOCKET_BUFSIZ]; 
    448         size_t data_len; 
    449         unsigned int address; 
     448        unsigned int address, data_len; 
    450449        int rc; 
    451450 
    452451        if (unit > reader->nslots) 
    453452                return IFD_ERROR_INVALID_SLOT; 
    454453 
    455454        if (ct_tlv_get_int(args, CT_TAG_ADDRESS, &address) == 0 
    456             || !ct_tlv_get_int(args, CT_TAG_COUNT, (unsigned int *)&data_len)) 
     455            || !ct_tlv_get_int(args, CT_TAG_COUNT, &data_len)) 
    457456                return IFD_ERROR_MISSING_ARG; 
    458457 
    459458        if (data_len > sizeof(data))