]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_cdsa_utils/lib/cuOidParser.cpp
Security-58286.270.3.0.1.tar.gz
[apple/security.git] / OSX / libsecurity_cdsa_utils / lib / cuOidParser.cpp
index d52276b61c1007cff370f28d5de1039eb293917e..d490d0f8de5722e69df3733f245c2208d872637d 100644 (file)
@@ -37,7 +37,7 @@
 
 /* get config file from .. or from . */
 #define                CONFIG_FILE_NAME        "dumpasn1.cfg"
-static const char      *CONFIG_FILE1 =         "../"CONFIG_FILE_NAME;
+static const char      *CONFIG_FILE1 =         "../" CONFIG_FILE_NAME;
 static const char      *CONFIG_FILE2 =         CONFIG_FILE_NAME;
 /* or from here via getenv */
 #define                CONFIG_FILE_ENV         "LOCAL_BUILD_DIR"
@@ -56,7 +56,7 @@ int readFileExtra(
 {
        int rtn;
        int fd;
-       unsigned char *buf;
+       unsigned char *buf = NULL;
        struct stat     sb;
        size_t size;
 
@@ -76,12 +76,9 @@ int readFileExtra(
                rtn = ENOMEM;
                goto errOut;
        }
-       rtn = (int)lseek(fd, 0, SEEK_SET);
-       if(rtn < 0) {
-               goto errOut;
-       }
        rtn = (int)read(fd, buf, (size_t)size);
        if(rtn != (int)size) {
+        free(buf);
                if(rtn >= 0) {
                        printf("readFile: short read\n");
                }