Skip to content

Conversation

@bpintea
Copy link
Collaborator

@bpintea bpintea commented Mar 11, 2020

This PR fixes two low-probability/impact defects:

  • when converting a bound parameter from string to an interval type, the destination buffer lacked space for the 0-terminator, which was nevertheless written. This was triggered by unit testing; this functionality has a very low use probability.
  • the recently added support for setting the current catalog came with a defect in the way the catalog (wide) string length was considered: character count vs. the normed byte count. That's now being corrected. This leads to the API call failure, but applications tend to ignore it, thus a low impact.

bpintea added 2 commits March 11, 2020 20:42
When converting a C-string to a wide string, the conversion function
0-terminates the output. However, the allocated destination buffer
lacked the space for the terminator. This commit fixes that.
The API function provides the byte count for the wide string name of the
catalog, not the character count, as so far implemented. This commit
fixes the lenght handling.
Copy link

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bpintea bpintea merged commit e390375 into elastic:master Mar 17, 2020
@bpintea bpintea deleted the fix/str_to_interval_buff_overrun branch March 17, 2020 22:17
bpintea added a commit that referenced this pull request Mar 17, 2020
… handling (#217)

* fix overrun when converting a c-string to interval

When converting a C-string to a wide string, the conversion function
0-terminates the output. However, the allocated destination buffer
lacked the space for the terminator. This commit fixes that.

* fix catalog setting

The API function provides the byte count for the wide string name of the
catalog, not the character count, as so far implemented. This commit
fixes the lenght handling.

(cherry picked from commit e390375)
bpintea added a commit that referenced this pull request Mar 17, 2020
… handling (#217)

* fix overrun when converting a c-string to interval

When converting a C-string to a wide string, the conversion function
0-terminates the output. However, the allocated destination buffer
lacked the space for the terminator. This commit fixes that.

* fix catalog setting

The API function provides the byte count for the wide string name of the
catalog, not the character count, as so far implemented. This commit
fixes the lenght handling.

(cherry picked from commit e390375)
bpintea added a commit that referenced this pull request Mar 17, 2020
… handling (#217)

* fix overrun when converting a c-string to interval

When converting a C-string to a wide string, the conversion function
0-terminates the output. However, the allocated destination buffer
lacked the space for the terminator. This commit fixes that.

* fix catalog setting

The API function provides the byte count for the wide string name of the
catalog, not the character count, as so far implemented. This commit
fixes the lenght handling.

(cherry picked from commit e390375)
@bpintea bpintea mentioned this pull request Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants