[MacPorts] #44469: libical build improvement

MacPorts noreply at macports.org
Mon Sep 22 15:41:03 PDT 2014


#44469: libical build improvement
--------------------------+--------------------------------
  Reporter:  rjvbertin@…  |      Owner:  macports-tickets@…
      Type:  enhancement  |     Status:  new
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:  2.3.1
Resolution:               |   Keywords:  haspatch
      Port:  libical      |
--------------------------+--------------------------------

Comment (by rjvbertin@…):

 Apply this patch

 {{{
 diff --git src/libicalvcal/icalvcal.c src/libicalvcal/icalvcal.c
 index 5263d0e..e046e0f 100644
 --- src/libicalvcal/icalvcal.c
 +++ src/libicalvcal/icalvcal.c
 @@ -171,11 +171,15 @@ icalcomponent* icalvcal_convert_with_defaults
 (VObject *object,
                                                icalvcal_defaults
 *defaults)
  {

 -   char* name =  (char*)vObjectName(object);
 +   char* name;
     icalcomponent* container;
     icalcomponent* root;
     icalproperty *prop;

 +   if( !object ){
 +       return NULL;
 +   }
 +   name =  (char*)vObjectName(object);
     icalerror_check_arg_rz( (object!=0),"Object");

     container = icalcomponent_new(ICAL_XROOT_COMPONENT);
 diff --git src/test/testvcal.c src/test/testvcal.c
 index f984674..518308c 100644
 --- src/test/testvcal.c
 +++ src/test/testvcal.c
 @@ -44,7 +44,7 @@ int main(int argc, char* argv[])
      char* file;

      if (argc != 2){
 -        file = "../../test-data/user-cal.vcf";
 +        file = "../test-data/user-cal.vcf";
      } else {
          file = argv[1];
      }
 }}}

 and then do `env DYLD_LIBRARY_PATH=<libical-build-dir>/lib make test` and
 the testvcal crash should have disappeared.

 NB: using `assert` statements to check against null pointers is nice, but
 ineffective when building in release mode. It's also not a very elegant
 way of handling errors in a shared library ...

-- 
Ticket URL: <https://trac.macports.org/ticket/44469#comment:11>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list