Hello community, here is the log from the commit of package python-sip for openSUSE:Factory checked in at Mon Aug 17 14:55:57 CEST 2009. -------- --- python-sip/python-sip.changes 2009-07-30 03:57:21.000000000 +0200 +++ /mounts/work_src_done/STABLE/python-sip/python-sip.changes 2009-08-05 00:56:41.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Aug 05 00:46:55 CEST 2009 - hpj@urpla.net + +- Fixed a crash with sipFindType() when the search happens to land on an + unresolved external type. + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- fix-unresolved-external-types.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-sip.spec ++++++ --- /var/tmp/diff_new_pack.ldgFs0/_old 2009-08-17 14:54:32.000000000 +0200 +++ /var/tmp/diff_new_pack.ldgFs0/_new 2009-08-17 14:54:32.000000000 +0200 @@ -24,12 +24,13 @@ Group: Development/Libraries/Python Summary: SIP tool to use python sip bindings Version: 4.8.2 -Release: 1 +Release: 2 %define rversion %version Url: http://www.riverbankcomputing.com/software/sip/intro BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: sip-%{rversion}.tar.bz2 Patch0: disable-rpaths.diff +Patch1: fix-unresolved-external-types.diff %py_requires %description @@ -69,6 +70,7 @@ %prep %setup -q -n sip-%{rversion} %patch0 +%patch1 -p1 %build export CFLAGS="$RPM_OPT_FLAGS" ++++++ fix-unresolved-external-types.diff ++++++ --- sip-4.8.2/siplib/siplib.c 2009-07-27 15:26:11.000000000 +0200 +++ sip-4.8.3-snapshot-20090729/siplib/siplib.c 2009-07-30 04:30:41.000000000 +0200 @@ -6052,14 +6052,49 @@ int sip_api_get_state(PyObject *transfer /* + * This is set by sip_api_find_type() before calling bsearch() on the types + * table for the module. This is a hack that works around the problem of + * unresolved externally defined types. + */ +static sipExportedModuleDef *module_searched; + + +/* * The bsearch() helper function for searching the types table. */ static int compareTypeDef(const void *key, const void *el) { const char *s1 = (const char *)key; - const char *s2 = sipTypeName(*(const sipTypeDef **)el); + const char *s2 = NULL; + const sipTypeDef *td; char ch1, ch2; + /* Allow for unresolved externally defined types. */ + td = *(const sipTypeDef **)el; + + if (td != NULL) + s2 = sipTypeName(td); + else + { + sipExternalTypeDef *etd = module_searched->em_external; + + assert(etd != NULL); + + /* Find which external type it is. */ + while (etd->et_nr >= 0) + { + const sipTypeDef **tdp = &module_searched->em_types[etd->et_nr]; + + if (tdp == (const sipTypeDef **)el) + { + s2 = etd->et_name; + break; + } + } + + assert(s2 != NULL); + } + /* * Compare while ignoring spaces so that we don't impose a rigorous naming * standard. This only really affects template-based mapped types. @@ -6092,12 +6127,21 @@ static const sipTypeDef *sip_api_find_ty { sipTypeDef **tdp; + /* The backdoor to the comparison helper. */ + module_searched = em; + tdp = (sipTypeDef **)bsearch((const void *)type, (const void *)em->em_types, em->em_nrtypes, sizeof (sipTypeDef *), compareTypeDef); if (tdp != NULL) + { + /* + * Note that this will be NULL for unresolved externally defined + * types. + */ return *tdp; + } } return NULL; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org