SOPC_Time_GetString crashes in case of invalid input

Description

OPC_Time_GetString crashes with an assert if the input DateTime value is out of bounds:


    time_t seconds = 0;
    SOPC_ReturnStatus status = SOPC_Time_ToUnixTime(time, &seconds);
    SOPC_ASSERT(status == SOPC_STATUS_OK);

Code version and environment identification

SHA:0a3a0f0e

Security impact

N.A. (availability issue)

Possible fixes

  • return NULL rather than raising an assertion
  • update .h description to indicate that an invalid input or internal failure to retrieva date leads to a NULL return value (already done for other filaure cases)
Assignee Loading
Time tracking Loading