Commit 41cd1a7
committed
mapi_lib: fix out-of-bounds access in PROBLEM_ARRAY::transform
Triggerable upon performing an online-mode search in OL2019.
==93973==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x502000087734 at pc 0x7ff932e5635f bp 0x7ff8a79fd240 sp
0x7ff8a79fd238
READ of size 2 at 0x502000087734 thread T73
f0 PROBLEM_ARRAY::transform(unsigned short const*) lib/mapi/element_data.cpp:407
f1 folder_object::set_properties(TPROPVAL_ARRAY const*, PROBLEM_ARRAY*) exch/emsmdb/folder_object.cpp:522
f2 rop_setproperties(TPROPVAL_ARRAY const*, PROBLEM_ARRAY*, LOGMAP*, unsigned char, unsigned int) exch/emsmdb/oxcprpt.cpp:385
f3 rop_dispatch(rop_request const&, rop_response*&, unsigned int*, unsigned char) exch/emsmdb/rop_dispatch.cpp:1062
0x502000087734 is located 2 bytes after 2-byte region [0x502000087730,0x502000087732)
allocated by thread T73 here:
f0 operator new[](unsigned long) (/lib64/libasan.so.8)
f1 std::__detail::_MakeUniq<char []>::__array std::make_unique<char []>(unsigned long) /usr/include/c++/13/bits/unique_ptr.h:1085
f2 alloc_context::alloc(unsigned long) include/gromox/util.hpp:39
f3 pdu_processor_ndr_stack_alloc(int, unsigned long) exch/http/pdu_processor.cpp:162
f4 emsmdb::common_util_alloc(unsigned long) exch/emsmdb/common_util.cpp:88
f5 unsigned short* emsmdb::cu_alloc<unsigned short>(unsigned long) exch/emsmdb/common_util.hpp:37
f6 folder_object::set_properties(TPROPVAL_ARRAY const*, PROBLEM_ARRAY*) exch/emsmdb/folder_object.cpp:482
f7 rop_setproperties(TPROPVAL_ARRAY const*, PROBLEM_ARRAY*, LOGMAP*, unsigned char, unsigned int) exch/emsmdb/oxcprpt.cpp:385
f8 rop_dispatch(rop_request const&, rop_response*&, unsigned int*, unsigned char) exch/emsmdb/rop_dispatch.cpp:1062
According to this report, poriginal_indices must have been a
1-element array and tmp_propvals 5-element, of which the 3rd,
PR_CHANGE_KEY, (somewhat mysteriously) was reported in PROBLEM_ARRAY.
Fixes: gromox-0~666
References: GXL-503, DESK-22091 parent c39628c commit 41cd1a7
File tree
8 files changed
+89
-58
lines changed- exch
- emsmdb
- zcore
- include/gromox
- lib/mapi
8 files changed
+89
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
319 | | - | |
| 324 | + | |
320 | 325 | | |
321 | 326 | | |
322 | 327 | | |
| |||
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
333 | | - | |
334 | | - | |
335 | | - | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
341 | 344 | | |
342 | 345 | | |
343 | | - | |
344 | | - | |
| 346 | + | |
| 347 | + | |
345 | 348 | | |
346 | 349 | | |
347 | 350 | | |
| |||
361 | 364 | | |
362 | 365 | | |
363 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
364 | 370 | | |
365 | 371 | | |
366 | 372 | | |
367 | | - | |
| 373 | + | |
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
| |||
378 | 384 | | |
379 | 385 | | |
380 | 386 | | |
381 | | - | |
382 | | - | |
383 | | - | |
| 387 | + | |
384 | 388 | | |
385 | 389 | | |
386 | 390 | | |
387 | 391 | | |
388 | 392 | | |
389 | 393 | | |
390 | 394 | | |
391 | | - | |
| 395 | + | |
392 | 396 | | |
393 | 397 | | |
394 | 398 | | |
| |||
409 | 413 | | |
410 | 414 | | |
411 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
412 | 419 | | |
413 | 420 | | |
414 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
458 | 463 | | |
459 | 464 | | |
460 | 465 | | |
461 | | - | |
| 466 | + | |
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
| |||
479 | 484 | | |
480 | 485 | | |
481 | 486 | | |
482 | | - | |
483 | | - | |
484 | | - | |
| 487 | + | |
485 | 488 | | |
486 | 489 | | |
487 | 490 | | |
488 | 491 | | |
489 | 492 | | |
490 | 493 | | |
491 | | - | |
492 | | - | |
| 494 | + | |
| 495 | + | |
493 | 496 | | |
494 | 497 | | |
495 | 498 | | |
| |||
522 | 525 | | |
523 | 526 | | |
524 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
525 | 531 | | |
526 | 532 | | |
527 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
664 | 665 | | |
665 | 666 | | |
666 | 667 | | |
667 | | - | |
| 668 | + | |
668 | 669 | | |
669 | 670 | | |
670 | 671 | | |
| |||
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
683 | | - | |
684 | | - | |
685 | | - | |
| 684 | + | |
686 | 685 | | |
687 | 686 | | |
688 | 687 | | |
689 | 688 | | |
690 | 689 | | |
691 | 690 | | |
692 | | - | |
693 | | - | |
| 691 | + | |
| 692 | + | |
694 | 693 | | |
695 | 694 | | |
696 | 695 | | |
| |||
703 | 702 | | |
704 | 703 | | |
705 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
706 | 708 | | |
707 | 709 | | |
708 | 710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
1054 | 1055 | | |
1055 | 1056 | | |
1056 | 1057 | | |
1057 | | - | |
| 1058 | + | |
1058 | 1059 | | |
1059 | 1060 | | |
1060 | 1061 | | |
| |||
1072 | 1073 | | |
1073 | 1074 | | |
1074 | 1075 | | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
| 1076 | + | |
| 1077 | + | |
1079 | 1078 | | |
1080 | 1079 | | |
1081 | 1080 | | |
| |||
1116 | 1115 | | |
1117 | 1116 | | |
1118 | 1117 | | |
1119 | | - | |
1120 | | - | |
| 1118 | + | |
| 1119 | + | |
1121 | 1120 | | |
1122 | 1121 | | |
1123 | 1122 | | |
| |||
1142 | 1141 | | |
1143 | 1142 | | |
1144 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1145 | 1147 | | |
1146 | 1148 | | |
1147 | 1149 | | |
| |||
1153 | 1155 | | |
1154 | 1156 | | |
1155 | 1157 | | |
1156 | | - | |
| 1158 | + | |
1157 | 1159 | | |
1158 | 1160 | | |
1159 | 1161 | | |
| |||
1169 | 1171 | | |
1170 | 1172 | | |
1171 | 1173 | | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
| 1174 | + | |
1175 | 1175 | | |
1176 | 1176 | | |
1177 | 1177 | | |
| |||
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
1193 | | - | |
| 1193 | + | |
1194 | 1194 | | |
1195 | 1195 | | |
1196 | 1196 | | |
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1221 | 1224 | | |
1222 | 1225 | | |
1223 | 1226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
565 | 566 | | |
566 | 567 | | |
567 | 568 | | |
568 | | - | |
| 569 | + | |
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
| |||
600 | 601 | | |
601 | 602 | | |
602 | 603 | | |
603 | | - | |
604 | | - | |
605 | | - | |
| 604 | + | |
606 | 605 | | |
607 | 606 | | |
608 | 607 | | |
| |||
626 | 625 | | |
627 | 626 | | |
628 | 627 | | |
629 | | - | |
| 628 | + | |
630 | 629 | | |
631 | 630 | | |
632 | 631 | | |
| |||
676 | 675 | | |
677 | 676 | | |
678 | 677 | | |
679 | | - | |
| 678 | + | |
680 | 679 | | |
681 | 680 | | |
682 | 681 | | |
| |||
710 | 709 | | |
711 | 710 | | |
712 | 711 | | |
713 | | - | |
| 712 | + | |
714 | 713 | | |
715 | 714 | | |
716 | 715 | | |
| |||
730 | 729 | | |
731 | 730 | | |
732 | 731 | | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
733 | 735 | | |
734 | 736 | | |
735 | 737 | | |
| |||
0 commit comments