Summary: | infinite loop in "pkg-config --libs" with repeated package names | ||
---|---|---|---|
Product: | pkg-config | Reporter: | James Henstridge <james> |
Component: | src | Assignee: | Tollef Fog Heen <tfheen> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | critical | ||
Priority: | high | ||
Version: | unspecified | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | pkg-config-0.17.1-dupnames.patch |
Description
James Henstridge
2005-04-13 01:37:34 UTC
Created attachment 2419 [details] [review] pkg-config-0.17.1-dupnames.patch Here's a patch that fixes the problem. When packages_get_l_libs() is building dups_list, it concatenates the result of get_l_libs() for each listed package. Now get_l_libs() returns one of the members of the Package structure, and shouldn't be modified. But by concatenating those lists, you end up with a cycle in the linked list. Then when string_list_strip_duplicates_from_back() tries to simplify the list, it has trouble when it tries to copy what seems to be an infinitely long linked list. Furthermore, if string_list_strip_duplicates_from_back() completes, when you free dups_list you'd leave invalid pointers in the various Package structures. packages_get_L_libs() has an equivalent problem, which the patch fixes in the same way. 2005-04-13 Tollef Fog Heen <tfheen@err.no> * pkg.c (packages_get_l_libs, packages_get_L_libs): Duplicate singly linked list before putting it on list passed to string_list_strip_duplicates_from_back to avoid infinite loop when g_slist_copy tries to copy self-linked list. This happens if the user specifies the same name on the command line twice. (Freedesktop #3006) |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.