merged
authorEdouard Tisserant <edouard@pep-project.org>
Mon, 17 Oct 2016 19:33:09 +0200
changeset 12909d62d6ea3239
parent 1289 c6753f5c5b75
parent 1287 b192a019fb73
child 1291 e17f94b55b0c
child 1292 c310459ec5d3
merged
     1.1 --- a/build-mac/pEpEngine.xcodeproj/project.pbxproj	Mon Oct 17 18:33:02 2016 +0200
     1.2 +++ b/build-mac/pEpEngine.xcodeproj/project.pbxproj	Mon Oct 17 19:33:09 2016 +0200
     1.3 @@ -11,6 +11,7 @@
     1.4  		4354FF651D6EDF300033069C /* sync_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = 4354FF641D6EDF300033069C /* sync_impl.c */; };
     1.5  		4354FF691D6EE1A70033069C /* NULL.c in Sources */ = {isa = PBXBuildFile; fileRef = 4354FF681D6EE1A70033069C /* NULL.c */; };
     1.6  		43BA0F461D7964750059172F /* asn1_helper.c in Sources */ = {isa = PBXBuildFile; fileRef = 43BA0F451D7964750059172F /* asn1_helper.c */; };
     1.7 +		43E9BC6A1DB51A1E00AD2352 /* GroupUpdate.c in Sources */ = {isa = PBXBuildFile; fileRef = 43E9BC691DB51A1E00AD2352 /* GroupUpdate.c */; };
     1.8  		6400FB861B8CA1C6005221E3 /* libnetpgp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 645922521B8BD32B00A5AF93 /* libnetpgp.a */; };
     1.9  		6400FB8B1B8CA1CF005221E3 /* libetpan-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64289E371B8B630200FC617B /* libetpan-ios.a */; };
    1.10  		644297C51BE11CE0002BC73B /* system.db in Resources */ = {isa = PBXBuildFile; fileRef = 64951A1B1BE0FCD800B10E71 /* system.db */; };
    1.11 @@ -191,6 +192,7 @@
    1.12  		4354FF641D6EDF300033069C /* sync_impl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync_impl.c; path = ../src/sync_impl.c; sourceTree = "<group>"; };
    1.13  		4354FF681D6EE1A70033069C /* NULL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = NULL.c; path = ../asn.1/NULL.c; sourceTree = "<group>"; };
    1.14  		43BA0F451D7964750059172F /* asn1_helper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = asn1_helper.c; path = ../src/asn1_helper.c; sourceTree = "<group>"; };
    1.15 +		43E9BC691DB51A1E00AD2352 /* GroupUpdate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = GroupUpdate.c; path = ../asn.1/GroupUpdate.c; sourceTree = "<group>"; };
    1.16  		644297BF1BE11C65002BC73B /* pEpTrustWords.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = pEpTrustWords.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
    1.17  		644297C11BE11C65002BC73B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
    1.18  		646788871CEB3D120001F54C /* map_asn1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = map_asn1.c; path = ../src/map_asn1.c; sourceTree = "<group>"; };
    1.19 @@ -360,6 +362,7 @@
    1.20  		6406CE811CE382F400C14D77 /* asn.1 */ = {
    1.21  			isa = PBXGroup;
    1.22  			children = (
    1.23 +				43E9BC691DB51A1E00AD2352 /* GroupUpdate.c */,
    1.24  				4354FF681D6EE1A70033069C /* NULL.c */,
    1.25  				646C40951D510CD700C63EFF /* asn_application.h */,
    1.26  				646C40961D510CD700C63EFF /* asn_codecs_prim.c */,
    1.27 @@ -790,6 +793,7 @@
    1.28  			buildActionMask = 2147483647;
    1.29  			files = (
    1.30  				64A826871B455D0800EECAF0 /* stringpair.c in Sources */,
    1.31 +				43E9BC6A1DB51A1E00AD2352 /* GroupUpdate.c in Sources */,
    1.32  				646C41341D510CD800C63EFF /* UTF8String.c in Sources */,
    1.33  				64A826831B455D0800EECAF0 /* platform_unix.c in Sources */,
    1.34  				646C40F81D510CD800C63EFF /* ber_tlv_length.c in Sources */,
     2.1 --- a/src/stringpair.c	Mon Oct 17 18:33:02 2016 +0200
     2.2 +++ b/src/stringpair.c	Mon Oct 17 19:33:09 2016 +0200
     2.3 @@ -10,20 +10,22 @@
     2.4  {
     2.5      stringpair_t *pair = NULL;
     2.6  
     2.7 +    // key and value should not be NULL, that's bad style (while legal)
     2.8 +
     2.9      assert(key);
    2.10 -    assert(value),
    2.11 +    assert(value);
    2.12  
    2.13      pair = calloc(1, sizeof(stringpair_t));
    2.14      assert(pair);
    2.15      if (pair == NULL)
    2.16          goto enomem;
    2.17  
    2.18 -    pair->key = strdup(key);
    2.19 +    pair->key = key ? strdup(key) : strdup("");
    2.20      assert(pair->key);
    2.21      if (pair->key == NULL)
    2.22          goto enomem;
    2.23  
    2.24 -    pair->value = strdup(value);
    2.25 +    pair->value = value ? strdup(value) : strdup("");
    2.26      assert(pair->value);
    2.27      if (pair->value == NULL)
    2.28          goto enomem;
     3.1 --- a/src/stringpair.h	Mon Oct 17 18:33:02 2016 +0200
     3.2 +++ b/src/stringpair.h	Mon Oct 17 19:33:09 2016 +0200
     3.3 @@ -16,8 +16,8 @@
     3.4  // new_stringpair() - allocate new stringpair_t
     3.5  //
     3.6  //  parameters:
     3.7 -//      key (in)        utf-8 string used as key; may point to "" but must not be NULL!
     3.8 -//      value (in)      utf-8 string containing the value; may point to "" but must not be NULL!
     3.9 +//      key (in)        utf-8 string used as key, should not be NULL
    3.10 +//      value (in)      utf-8 string containing the value, should not be NULL
    3.11  //
    3.12  //  return value:
    3.13  //      pointer to stringpair_t or NULL on failure