]> www.wagner.pp.ru Git - oss/catdoc.git/blobdiff - src/ole.c
Make clang static analyzer 3.5 happy
[oss/catdoc.git] / src / ole.c
index 9931b579cea2fc7a48cc4e536c316d519347f80a..d1c731ddf8a309127428d168096e1ec38c1fba7f 100644 (file)
--- a/src/ole.c
+++ b/src/ole.c
@@ -37,7 +37,7 @@ long propCurNumber, propLen, propNumber, propStart;
 unsigned char *properties=NULL;
 long int fileLength=0;
 
-static unsigned char ole_sign[]={0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1,0};
+static char ole_sign[]={0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1,0};
 
 
 /** 
@@ -97,7 +97,7 @@ FILE* ole_init(FILE *f, void *buffer, size_t bufSize)  {
        if ( ret != BBD_BLOCK_SIZE ) {
                return NULL;
        }
-       if (strncmp(oleBuf,ole_sign,8) != 0) {
+       if (strncmp((char *)&oleBuf,ole_sign,8) != 0) {
                return NULL;
        }
        sectorSize = 1<<getshort(oleBuf,0x1e);
@@ -328,6 +328,7 @@ FILE *ole_readdir(FILE *f) {
                (e->startBlock <=
                 fileLength/(e->isBigBlock ? sectorSize : shortSectorSize))) {
                if((e->blocks=malloc(chainMaxLen*sizeof(long int))) == NULL ) {
+                       free(e);
                        return NULL;
                }
                while(1) {