From: Michael Schroeder Date: Wed, 24 Apr 2013 10:19:49 +0000 (+0200) Subject: Do not segfault when undef/None/nil is passwd as FILE/Dep X-Git-Tag: BASE-SuSE-Code-12_3-Branch~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd680e014c9ec7617378d5dce6cd96ae8833a96c;p=thirdparty%2Flibsolv.git Do not segfault when undef/None/nil is passwd as FILE/Dep --- diff --git a/bindings/solv.i b/bindings/solv.i index d4e1c979..e48fc900 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -346,7 +346,7 @@ SWIG_AsValSolvFpPtr(void *obj, FILE **val) { if (!desc) desc = SWIG_TypeQuery("SolvFp *"); if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) { if (val) - *val = ((SolvFp *)vptr)->fp; + *val = vptr ? ((SolvFp *)vptr)->fp : 0; return SWIG_OK; } #ifdef SWIGPYTHON @@ -377,7 +377,7 @@ SWIG_AsValDepId(void *obj, int *val) { return ecode; if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) { if (val) - *val = ((Dep *)vptr)->id; + *val = vptr ? ((Dep *)vptr)->id : 0; return SWIG_OK; } return SWIG_TypeError;