[Possible] minor bug in platform_write_dct()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
cogoc_1937206
Level 4
Level 4
First like received

Hello,

I've been perusing the DCT code to get a better feel for how it works.  (My main concern was how/if backwards compatibility would be handled if, for example, the device was upgraded to v1.2 which added new DCT data, then downgraded back to v1.1.  Looks like this will be fine.)

Anyway, if I understand the code correctly, the data-length check at the beginning of platform_write_dct() isn't quite right.  It's currently:

    /* Check if the data is too big to write */

    if ( data_length + data_start_offset > ( PLATFORM_DCT_COPY1_END_ADDRESS - PLATFORM_DCT_COPY1_START_ADDRESS ) )

    {

        return -1;

    }

But I think it should be:

    /* Check if the data is too big to write */

    if ( sizeof(platform_dct_header_t) + data_length + data_start_offset > ( PLATFORM_DCT_COPY1_END_ADDRESS - PLATFORM_DCT_COPY1_START_ADDRESS ) )

    {

        return -1;

    }

More generally -- is this the place you'd like people to be submitting bug reports?

Cheers!

0 Likes
1 Reply
SeyhanA_31
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hi,

Thank you very much, you are correct. There is a possible bug during dct data write to the flash if the total data is greater than 16K. Issue will be fixed on next release.

Thanks,

Seyhan

0 Likes