[
https://issues.apache.org/jira/browse/AVRO-3221?focusedWorklogId=660977&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-660977
]
ASF GitHub Bot logged work on AVRO-3221:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Oct/21 14:55
Start Date: 06/Oct/21 14:55
Worklog Time Spent: 10m
Work Description: ashdnazg opened a new pull request #1352:
URL: https://github.com/apache/avro/pull/1352
Previously all `size` bytes were copied from the given string,
including the required NUL terminator, and then another NUL terminator
was appended in avro_raw_string_set_length.
Now the existence of the NUL terminator is verified, allowing to
catch programmer mistakes and then only `size` - 1 bytes are copied
before appending the NUL terminator.
Make sure you have checked _all_ steps below.
### Jira
- [x] My PR addresses the following [Avro
Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them
in the PR title. For example, "AVRO-1234: My Avro PR"
- https://issues.apache.org/jira/browse/AVRO-3221
- In case you are adding a dependency, check if the license complies with
the [ASF 3rd Party License
Policy](https://www.apache.org/legal/resolved.html#category-x).
### Tests
- [x] My PR adds the following unit tests __OR__ does not need testing for
this extremely good reason:
Test that setting a non-null terminated string fails.
### Commits
- [x] My commits all reference Jira issues in their subject lines. In
addition, my commits follow the guidelines from "[How to write a good git
commit message](https://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 660977)
Remaining Estimate: 0h
Time Spent: 10m
> Verify NUL termination on set_string_len and make buffer more compact.
> ----------------------------------------------------------------------
>
> Key: AVRO-3221
> URL: https://issues.apache.org/jira/browse/AVRO-3221
> Project: Apache Avro
> Issue Type: Improvement
> Components: c
> Reporter: Eshed Shaham
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {{set_string_len}} expects the size to include a NUL terminator, but that's
> not enforced in code. In addition, when it calls
> {{avro_raw_string_set_length}}, that function adds another NUL terminator on
> top of the expected one.
> Fixing both of these issues does not change the behaviour for valid inputs,
> and makes sure the function fails for invalid inputs (non-null terminated
> strings).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)