Repository navigation
Commit 0451443
authored
[fix](function) Enforce input boundaries in IP functions (#68160)
IP functions did not consistently respect the explicit boundaries of
`ColumnString` values. IPv4 and IPv6 text conversions accepted an
otherwise valid address followed by an embedded NUL byte and trailing
data because unbounded parser overloads stopped at the first NUL. In
addition, `is_ipv4_compat` and `is_ipv4_mapped` discarded each binary
string's length and unconditionally read 16 bytes, so short values could
consume bytes from the following row and produce results that changed
with filtering, while oversized values were accepted based only on their
first 16 bytes. Root cause: both paths reduced length-aware string
values to raw pointers before parsing or inspection. This change uses
bounded parsers throughout, removes the unsafe null-terminated parser
overloads, maps parsed IPv4 values directly to IPv6, and requires binary
IPv6 inputs to be exactly 16 bytes before inspecting them. Unit coverage
includes throw, default, nullable, vector, constant, short, valid, and
oversized input paths.
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->1 parent 1271f00 commit 0451443
4 files changed
Lines changed: 107 additions & 83 deletions
File tree
- be
- src
- exec/common
- exprs/function
- test
- core/column
- exprs/function
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | 182 | | |
198 | 183 | | |
199 | 184 | | |
| |||
480 | 465 | | |
481 | 466 | | |
482 | 467 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | 468 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
139 | | - | |
| 139 | + | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | 160 | | |
164 | 161 | | |
165 | 162 | | |
| |||
169 | 166 | | |
170 | 167 | | |
171 | 168 | | |
172 | | - | |
173 | 169 | | |
174 | 170 | | |
175 | 171 | | |
176 | 172 | | |
177 | 173 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 174 | + | |
| 175 | + | |
183 | 176 | | |
184 | 177 | | |
185 | 178 | | |
| |||
191 | 184 | | |
192 | 185 | | |
193 | 186 | | |
194 | | - | |
195 | | - | |
196 | 187 | | |
197 | 188 | | |
198 | 189 | | |
| |||
384 | 375 | | |
385 | 376 | | |
386 | 377 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | 378 | | |
397 | 379 | | |
398 | 380 | | |
| |||
401 | 383 | | |
402 | 384 | | |
403 | 385 | | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
408 | 389 | | |
409 | 390 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | 391 | | |
419 | 392 | | |
420 | 393 | | |
| |||
431 | 404 | | |
432 | 405 | | |
433 | 406 | | |
434 | | - | |
435 | 407 | | |
436 | 408 | | |
437 | 409 | | |
| |||
442 | 414 | | |
443 | 415 | | |
444 | 416 | | |
445 | | - | |
| 417 | + | |
446 | 418 | | |
447 | | - | |
448 | | - | |
449 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
450 | 422 | | |
451 | | - | |
| 423 | + | |
452 | 424 | | |
453 | 425 | | |
454 | 426 | | |
| |||
479 | 451 | | |
480 | 452 | | |
481 | 453 | | |
482 | | - | |
483 | 454 | | |
484 | 455 | | |
485 | 456 | | |
| |||
1018 | 989 | | |
1019 | 990 | | |
1020 | 991 | | |
1021 | | - | |
1022 | | - | |
| 992 | + | |
| 993 | + | |
1023 | 994 | | |
1024 | 995 | | |
1025 | 996 | | |
| |||
1029 | 1000 | | |
1030 | 1001 | | |
1031 | 1002 | | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1035 | 1007 | | |
1036 | 1008 | | |
1037 | 1009 | | |
| |||
1058 | 1030 | | |
1059 | 1031 | | |
1060 | 1032 | | |
1061 | | - | |
1062 | | - | |
| 1033 | + | |
| 1034 | + | |
1063 | 1035 | | |
1064 | 1036 | | |
1065 | 1037 | | |
| |||
1069 | 1041 | | |
1070 | 1042 | | |
1071 | 1043 | | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1075 | 1047 | | |
1076 | 1048 | | |
1077 | 1049 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
| 307 | + | |
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
310 | | - | |
| 311 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
42 | 122 | | |
43 | 123 | | |
44 | 124 | | |
| |||
0 commit comments