Commit fbe88b4
authored
fix: add missing output pointer validation in array schema conversion functions (#5787)
## Summary
Four public C API functions in `array_schema_api.cc` dereference their
output pointer parameters without first validating them. Passing `null`
for any of these output pointers causes a segfault rather than returning
`TILEDB_ERR`:
- `tiledb_array_type_to_str`
- `tiledb_array_type_from_str`
- `tiledb_layout_to_str`
- `tiledb_layout_from_str`
The fix adds `ensure_output_pointer_is_valid()` to each function,
matching the pattern used throughout the rest of the C API. The function
immediately following these four in the same file
(`tiledb_array_schema_alloc`) already uses this validation correctly.
## Test plan
- [ ] Confirm existing array schema C API tests still pass
- [ ] Manually verify that passing `null` to each affected function now
returns `TILEDB_ERR` instead of segfaulting
🤖 Generated with [Claude Code](https://claude.ai/claude-code)
---
TYPE: IMPROVEMENT
DESC: Added extra null pointer validation for a couple of APIs.1 parent 16cf508 commit fbe88b4
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
0 commit comments