Commit 85c18a0
authored
### Rationale for this change
The binary_string function will attempt to allocate 0 bytes of memory, which results in a null ptr being returned and the function interprets that as an error.
### What changes are included in this PR?
Add kCanReturnErrors to the function definition to match other string functions.
Move the check for 0 byte length input earlier in the binary_string function to prevent the 0 allocation.
Add a unit test.
### Are these changes tested?
Yes, unit and integration testing.
### Are there any user-facing changes?
No.
* GitHub Issue: #49034
Authored-by: Logan Riggs <logan.riggs@dremio.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent adef2ef commit 85c18a0
3 files changed
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
| 436 | + | |
436 | 437 | | |
437 | 438 | | |
438 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2252 | 2252 | | |
2253 | 2253 | | |
2254 | 2254 | | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
2255 | 2260 | | |
2256 | 2261 | | |
2257 | 2262 | | |
| |||
2261 | 2266 | | |
2262 | 2267 | | |
2263 | 2268 | | |
2264 | | - | |
2265 | | - | |
2266 | | - | |
2267 | | - | |
2268 | | - | |
2269 | 2269 | | |
2270 | 2270 | | |
2271 | 2271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1883 | 1883 | | |
1884 | 1884 | | |
1885 | 1885 | | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
1889 | | - | |
1890 | 1886 | | |
1891 | 1887 | | |
1892 | 1888 | | |
| |||
1912 | 1908 | | |
1913 | 1909 | | |
1914 | 1910 | | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
1915 | 1927 | | |
1916 | 1928 | | |
1917 | 1929 | | |
| |||
0 commit comments