Commit 9ac54f0
committed
[daap] Fix null pointer deref in parse_meta()
Description
NULL Pointer Dereference in daap_reply_playlists (src/httpd_daap.c:1483).
Analysis
When the meta parameter contains consecutive commas (e.g. "abc,,def"), The
function parse_meta does not increment nmeta correctly and may leave NULL
values in the meta array. After calling parse_meta, The function
daap_reply_playlists accesses the member dfm of meta[i], causing a NULL Pointer
Dereference.
Steps to reproduce
Sending the following request (followed by two CRLFs):
GET /databases/1/containers?meta=abc,,def HTTP/1.1
Thanks @archersec for finding and reporting. Fixes #1961.1 parent 3d1652d commit 9ac54f0
3 files changed
+42
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
| 595 | + | |
595 | 596 | | |
596 | 597 | | |
597 | 598 | | |
598 | | - | |
599 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
600 | 603 | | |
601 | | - | |
| 604 | + | |
| 605 | + | |
602 | 606 | | |
603 | 607 | | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | 608 | | |
617 | | - | |
618 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
619 | 613 | | |
620 | | - | |
621 | | - | |
622 | | - | |
| 614 | + | |
| 615 | + | |
623 | 616 | | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
| 617 | + | |
| 618 | + | |
633 | 619 | | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | 620 | | |
638 | | - | |
639 | | - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
640 | 628 | | |
641 | 629 | | |
642 | | - | |
| 630 | + | |
| 631 | + | |
643 | 632 | | |
644 | 633 | | |
645 | | - | |
646 | | - | |
647 | | - | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
648 | 639 | | |
649 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
650 | 644 | | |
| 645 | + | |
| 646 | + | |
651 | 647 | | |
652 | 648 | | |
| 649 | + | |
653 | 650 | | |
654 | 651 | | |
655 | 652 | | |
| |||
0 commit comments