LocalizedText write: authorize invariant locale and same locale on existing instance

Description

Write operation on a LocalizedText fails in server in several cases when an existing unique locale is already defined as default:

  1. if the write operation uses the invariant locale
  2. if the write operation uses the same locale as the existent one but is not in supported locale list

In both cases it seems acceptable to accept the write operation:

  1. Writing the invariant locale is indicated as valid by the specification which does not restrict it explicitly when a locale is already present.
  2. If the default locale was already unsupported on initialization, it should be acceptable to re-use it.

Code version identification

cd867498

Security impact

N.A.

Implementation

Write operation on a LocalizedText is implemented by SOPC_LocalizedText_AddOrSetLocale (and SOPC_LocalizedText_AddOrSetLocale_Internal_SetSupported). Add exceptional cases to manage overwrite of the current "default locale" with the invariant (empty) locale or the same locale, if the invariant local is set add the non-invariant one in the list of locales.

Edited Feb 06, 2025 by Vincent Monfort
Assignee Loading
Time tracking Loading