Commit 6b2694c
committed
HL: Fix prefix-match bugs in H5TB field lookup and H5DS/H5IM CLASS checks
- H5TB: strcmp replaces strncmp in H5TBfind_field so that field names
that are a prefix of a requested name (or vice-versa) are no longer
matched. HLTB_MAX_FIELD_LEN (255) is now public in H5TBpublic.h and
exposed to Fortran as HLTB_MAX_FIELD_LEN_F in H5TBff.F90.
H5TBget_field_info documents the buffer-size requirement and truncation
behaviour. H5TBget_field_info guards against overflow on long names.
- H5IM: H5IMis_image and H5IMis_palette refactored into a shared helper
(H5IM__class_attr_equals). The helper now reads both fixed-length and
variable-length CLASS string attributes, using H5Treclaim for VL memory.
strcmp replaces strncmp for exact-match semantics.
- H5DS: H5DSis_scale and H5DS_is_reserved both support variable-length
CLASS string attributes via H5Aget_space/H5Aread/H5Treclaim. The
fixed-length path retains the 16-byte size guard. strcmp is used
throughout for exact comparison.
- Tests: new test functions test_is_scale_class_prefix,
test_is_reserved_class_prefix, and test_class_prefix cover fixed-length
prefix/exact/wrong-value cases and variable-length string cases.
test_table.c adds write and read field-name prefix rejection cases and
boundary-length truncation verification. All malloc calls are NULL-checked.
- CHANGELOG updated with a summary of all fixes.1 parent 013e9cc commit 6b2694c
11 files changed
Lines changed: 887 additions & 203 deletions
File tree
- hl
- fortran/src
- src
- test
- release_docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
209 | 215 | | |
210 | 216 | | |
211 | 217 | | |
| 218 | + | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| |||
325 | 333 | | |
326 | 334 | | |
327 | 335 | | |
328 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
329 | 339 | | |
330 | 340 | | |
331 | 341 | | |
| |||
1057 | 1067 | | |
1058 | 1068 | | |
1059 | 1069 | | |
1060 | | - | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1061 | 1076 | | |
1062 | | - | |
1063 | | - | |
| 1077 | + | |
| 1078 | + | |
1064 | 1079 | | |
1065 | 1080 | | |
1066 | 1081 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2221 | 2221 | | |
2222 | 2222 | | |
2223 | 2223 | | |
| 2224 | + | |
2224 | 2225 | | |
2225 | 2226 | | |
2226 | 2227 | | |
| |||
2261 | 2262 | | |
2262 | 2263 | | |
2263 | 2264 | | |
2264 | | - | |
2265 | | - | |
2266 | | - | |
| 2265 | + | |
2267 | 2266 | | |
2268 | | - | |
2269 | | - | |
2270 | | - | |
2271 | | - | |
2272 | 2267 | | |
2273 | | - | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
2280 | | - | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
2281 | 2273 | | |
2282 | | - | |
2283 | | - | |
2284 | | - | |
2285 | | - | |
2286 | | - | |
2287 | | - | |
2288 | | - | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
2289 | 2293 | | |
2290 | | - | |
2291 | | - | |
2292 | | - | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
2293 | 2302 | | |
2294 | | - | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
2295 | 2309 | | |
2296 | | - | |
2297 | | - | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
2298 | 2314 | | |
2299 | | - | |
2300 | | - | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
2301 | 2321 | | |
2302 | 2322 | | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
2306 | | - | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
2311 | 2328 | | |
| 2329 | + | |
2312 | 2330 | | |
2313 | 2331 | | |
2314 | 2332 | | |
| |||
2441 | 2459 | | |
2442 | 2460 | | |
2443 | 2461 | | |
| 2462 | + | |
2444 | 2463 | | |
2445 | 2464 | | |
2446 | 2465 | | |
| |||
2463 | 2482 | | |
2464 | 2483 | | |
2465 | 2484 | | |
2466 | | - | |
2467 | | - | |
| 2485 | + | |
2468 | 2486 | | |
2469 | 2487 | | |
2470 | | - | |
2471 | | - | |
2472 | | - | |
2473 | | - | |
2474 | | - | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
2475 | 2509 | | |
2476 | | - | |
2477 | | - | |
2478 | | - | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
2479 | 2518 | | |
2480 | | - | |
2481 | | - | |
2482 | | - | |
2483 | | - | |
2484 | | - | |
2485 | | - | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
2486 | 2523 | | |
2487 | | - | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
2488 | 2532 | | |
2489 | 2533 | | |
2490 | 2534 | | |
| |||
0 commit comments