From 11ce2cfd70df264c5c91b4daaa9a01c5abc673b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Jan 2005 04:39:16 +0000 Subject: r4591: - converted the other _p talloc functions to not need _p - added #if TALLOC_DEPRECATED around the _p functions - fixes the code that broke from the above while doing this I fixed quite a number of places that were incorrectly using the non type-safe talloc functions to use the type safe ones. Some were even doing multiplies for array allocation, which is potentially unsafe. (This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e) --- source4/ntvfs/posix/pvfs_dirlist.c | 6 +++--- source4/ntvfs/posix/pvfs_streams.c | 4 ++-- source4/ntvfs/posix/xattr_system.c | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'source4/ntvfs/posix') diff --git a/source4/ntvfs/posix/pvfs_dirlist.c b/source4/ntvfs/posix/pvfs_dirlist.c index 5c67b2d189..c2e8f826a2 100644 --- a/source4/ntvfs/posix/pvfs_dirlist.c +++ b/source4/ntvfs/posix/pvfs_dirlist.c @@ -137,9 +137,9 @@ NTSTATUS pvfs_list_start(struct pvfs_state *pvfs, struct pvfs_filename *name, dir->no_wildcard = False; dir->end_of_search = False; dir->offset = 0; - dir->name_cache = talloc_zero_array_p(dir, - struct name_cache_entry, - NAME_CACHE_SIZE); + dir->name_cache = talloc_zero_array(dir, + struct name_cache_entry, + NAME_CACHE_SIZE); if (dir->name_cache == NULL) { talloc_free(dir); return NT_STATUS_NO_MEMORY; diff --git a/source4/ntvfs/posix/pvfs_streams.c b/source4/ntvfs/posix/pvfs_streams.c index 12f783e172..e92732b810 100644 --- a/source4/ntvfs/posix/pvfs_streams.c +++ b/source4/ntvfs/posix/pvfs_streams.c @@ -283,7 +283,7 @@ ssize_t pvfs_stream_write(struct pvfs_state *pvfs, blob = data_blob(NULL, 0); } if (count+offset > blob.length) { - blob.data = talloc_realloc(blob.data, blob.data, count+offset); + blob.data = talloc_realloc(blob.data, blob.data, uint8_t, count+offset); if (blob.data == NULL) { errno = ENOMEM; return -1; @@ -339,7 +339,7 @@ NTSTATUS pvfs_stream_truncate(struct pvfs_state *pvfs, if (length <= blob.length) { blob.length = length; } else if (length > blob.length) { - blob.data = talloc_realloc(blob.data, blob.data, length); + blob.data = talloc_realloc(blob.data, blob.data, uint8_t, length); if (blob.data == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source4/ntvfs/posix/xattr_system.c b/source4/ntvfs/posix/xattr_system.c index c86ee0bd87..f19177f44c 100644 --- a/source4/ntvfs/posix/xattr_system.c +++ b/source4/ntvfs/posix/xattr_system.c @@ -51,7 +51,8 @@ again: } if (ret == -1 && errno == ERANGE) { estimated_size *= 2; - blob->data = talloc_realloc(mem_ctx, blob->data, estimated_size); + blob->data = talloc_realloc(mem_ctx, blob->data, + uint8_t, estimated_size); if (blob->data == NULL) { return NT_STATUS_NO_MEMORY; } -- cgit