pull/138/merge
safocl 2025-01-30 03:43:22 +04:00 committed by GitHub
commit c571572848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 0 deletions

View File

@ -2050,6 +2050,8 @@ static INDEX_ENTRY *ntfs_index_walk_down(INDEX_ENTRY *ie,
ictx->ir = (INDEX_ROOT*)NULL;
ictx->ib = (INDEX_BLOCK*)ntfs_malloc(ictx->block_size);
if (!ictx->ib)
return NULL;
ictx->pindex = 1;
ictx->is_in_root = FALSE;
} else {

View File

@ -1646,6 +1646,8 @@ static struct CACHED_PERMISSIONS *enter_cache(struct SECURITY_CONTEXT *scx,
cacheblock = (struct CACHED_PERMISSIONS*)
malloc(sizeof(struct CACHED_PERMISSIONS)
<< CACHE_PERMISSIONS_BITS);
if (!cacheblock)
return NULL;
pcache->cachetable[index1] = cacheblock;
for (i=0; i<(1 << CACHE_PERMISSIONS_BITS); i++)
cacheblock[i].valid = 0;

View File

@ -301,6 +301,10 @@ struct ATTR *getattrentry(unsigned int key, unsigned int lth)
} else {
attrtable = (struct ATTR**)
malloc(sizeof(struct ATTR*));
if (!attrtable){
free(pa);
return NULL;
}
attrtable[0] = pa;
}
pa->key = key;
@ -349,6 +353,8 @@ static const struct BUFFER *read_buffer(CONTEXT *ctx, unsigned int num)
if (!buffer) {
buffer = (struct BUFFER*)
malloc(sizeof(struct BUFFER) + blocksz);
if (!buffer)
return NULL;
buffer->size = blocksz;
buffer->rnum = num + 1; /* forced to being read */
buffer->safe = FALSE;
@ -2474,6 +2480,8 @@ static u16 overlapshow(CONTEXT *ctx, u16 k, u32 blk, const struct BUFFER *buf,
if ((space >= LOG_RECORD_HEAD_SZ)
&& (size > space)) {
fullrec = (char*)malloc(size);
if (!fullrec)
return 0;
if (size <= (space + nextspace)) {
/* Overlap on two blocks */
memcpy(fullrec,&data[k],space);
@ -3356,6 +3364,8 @@ static TRISTATE backoverlap(CONTEXT *ctx, int blk,
&& (size > space)
&& (size < MAXRECSIZE)) {
fullrec = (char*)malloc(size);
if (!fullrec)
return T_ERR;
memcpy(fullrec,&data[k],space);
if (size <= (space + nextspace))
memcpy(&fullrec[space], nextdata + blkheadsz,

View File

@ -975,6 +975,10 @@ struct mft_search_ctx * mft_get_search_ctx(ntfs_volume *vol)
}
ctx = (struct mft_search_ctx*)calloc(1, sizeof *ctx);
if(!ctx){
errno = ENOMEM;
return NULL;
}
ctx->mft_num = -1;
ctx->vol = vol;