Bug 877540
| Summary: | Buffer overflow when including commoncpp2 if gethostbyname fails | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Tristan Matthews <tristan.matthews> | ||||||
| Component: | commoncpp2 | Assignee: | Andreas Thienemann <andreas> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 18 | CC: | andreas, tristan.matthews | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2014-02-05 13:06:53 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
Created attachment 646585 [details]
Fixes buffer overflow error
This bug is present in Fedora 17 and Fedora 18. This message is a reminder that Fedora 18 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 18. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '18'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 18's end of life. Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 18 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior to Fedora 18's end of life. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |
Created attachment 646572 [details] test case that forces the bug Description of problem: There is a buffer overflow bug in commoncpp2-1.8.1/src/inaddr.cpp (line 336): memset((void *)&ipaddr[0], 0, sizeof(ipaddr)); which should be: memset((void *)&ipaddr[0], 0, sizeof(ipaddr[0])); Note that this will only fail on systems where a pointer is larger than the sizeof the ipaddr struct, namely 64 bit systems. Version-Release number of selected component (if applicable): Name : commoncpp2 Arch : i686 Version : 1.8.1 Release : 2.fc17 Size : 215 k Repo : fedora How reproducible: Any program that depends on commoncpp2 and runs while gethostbyname is unable to return host info (i.e. connectivity issues) will crash before entering its main function, as this bug happens when initializing a static variable in libcommoncpp2. This affects all 64 bit systems. Steps to Reproduce: Compile and run the attached testcase which forces the bug by instantiating a bogus address, using c++ test.cpp -o test `pkg-config --cflags --libs libccgnu2` -g ./test Actual results: The program crashes with a buffer overflow error: *** buffer overflow detected ***: ./test terminated Expected results: The program should exit normally. Additional info: I've attached the test case and a patch.