View Issue Details

IDProjectCategoryView StatusLast Update
000704010000-006: MappingsSpecpublic2021-11-16 16:49
ReporterChristian Zugfil Assigned ToRandy Armstrong  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version1.05.01 RC1 
Summary0007040: how to handle received strings containing invalid characters
Description

From https://reference.opcfoundation.org/Core/docs/Part3/8.32/
This (String) Built-in DataType defines a Unicode character string that should exclude control characters that are not whitespaces.

How shall/may a receiver react if a string contains those invalid characters?
May the string be rejected during decoding by creating a decoder error?
Shall the string be passed to the application unaltered?
Shall the application check/validate the string before using it for further processing?

Some encodings or programming languages might not be able to handle strings with certain characters.
Should transcoding of messages without loss of information always be possible?

TagsNo tags attached.
Commit Version
Fix Due Date

Relationships

has duplicate 0007197 closedRandy Armstrong String encoding with length 0 and String with length -1! 
related to 0007277 closedRandy Armstrong 5.2.2.4 String - incorrect text for null terminator 

Activities

Christian Zugfil

2021-06-23 09:41

reporter   ~0014595

The main concern is an embedded NUL terminator in a string.
It already happened that (by accident, bug in length calculation) encoded strings contained the terminating \0 at the end. This caused problems because different vendors seem to handle such content differently. Sometimes an error is generated, sometimes the string is trimmed to the first \0, sometimes it is forwarded without alteration or notice.
Embedded \0 in strings are a problem in other encodings, like XML, too. This means, forwarding values or messages over multiple connections using different encodings is likely to fail. Sometimes escaping those characters may be an option, sometimes not. but encoders must be prepared for this, if required.
Therefore, the definition of valid characters in a string and the reaction to invalid characters should be precise, without may and shall, if possible.
The use of ByteString is an alternative when special characters are required.

Matthias Damm

2021-06-25 08:30

developer   ~0014596

There is zero chance that a string with a null character in the middle of a string would be handled right if you process it in different layers with different protocols and different applications.

There is no practical use case for it but it would create endless work to handle it right in a lot of implementations.

We should simply explicitly disallow NULL in a string.
This is not a Part 6 issue, this is a Part 3 issue!

Randy Armstrong

2021-08-14 04:49

administrator   ~0014745

Added:

Strings with embedded nulls (‘\u0000’) are not guaranteed to be interoperable because not all DevelopmentPlatforms will be able to handle Strings with embedded nulls. Encoders may encode Strings with embedded nulls. Decoders may truncate the String at the first embedded null before passing it on to the application.

in OPC 10000-6 - UA Specification Part 6 - Mappings 1.05.3 RC

Randy Armstrong

2021-08-17 16:22

administrator   ~0014752

Reviewed in WG - need to review version table text.

Jim Luth

2021-11-16 16:48

administrator   ~0015313

Agreed to final change to table text.

Jim Luth

2021-11-16 16:49

administrator   ~0015314

Agree to changes

Issue History

Date Modified Username Field Change
2021-06-22 12:42 Christian Zugfil New Issue
2021-06-22 16:58 Jim Luth Project 10000-003: Address Space => 10000-006: Mappings
2021-06-22 16:59 Jim Luth Assigned To => Randy Armstrong
2021-06-22 16:59 Jim Luth Status new => assigned
2021-06-23 09:41 Christian Zugfil Note Added: 0014595
2021-06-25 08:30 Matthias Damm Note Added: 0014596
2021-08-14 04:49 Randy Armstrong Status assigned => resolved
2021-08-14 04:49 Randy Armstrong Resolution open => fixed
2021-08-14 04:49 Randy Armstrong Note Added: 0014745
2021-08-17 16:22 Randy Armstrong Note Added: 0014752
2021-08-18 06:05 Randy Armstrong Relationship added has duplicate 0007197
2021-09-22 08:33 Randy Armstrong Relationship added related to 0007277
2021-11-16 16:48 Jim Luth Note Added: 0015313
2021-11-16 16:49 Jim Luth Status resolved => closed
2021-11-16 16:49 Jim Luth Fixed in Version => 1.05.01 RC1
2021-11-16 16:49 Jim Luth Note Added: 0015314