freebsd-dev/module/zfs
Ned Bass 7b2d78a046 Fix improper null-byte termination handling
Fix a few cases where null-byte termination of strings was done
unnecessarily or incorrectly.

- The snprintf() function always produces a null-byte terminated string
  for non-negative return values, so it is not necessary to write out a
  null-byte as a separate step.

- Also, it is unsafe to use the return value of snprintf() as an offset
  for placing a null-byte, because if the output was truncated the return
  value is the number of bytes that _would_ have been written had enough
  space been available. Therefore the return value may index beyond the
  array boundaries.

- Finally, snprintf() accounts for the null-byte when limiting its output
  size, so there is no need to pass it a size parameter that is one less
  than the buffer size.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2875
2014-11-17 15:28:59 -08:00
..
arc.c Fix dprintf format specifiers 2014-11-17 11:13:45 -08:00
blkptr.c Illumos 4757, 4913 2014-08-01 14:28:05 -07:00
bplist.c
bpobj.c Illumos 4757, 4913 2014-08-01 14:28:05 -07:00
bptree.c Fix dprintf format specifiers 2014-11-17 11:13:45 -08:00
dbuf_stats.c Fix improper null-byte termination handling 2014-11-17 15:28:59 -08:00
dbuf.c Undirty freed spill blocks. 2014-11-17 11:25:48 -08:00
ddt_zap.c
ddt.c Change the default 'zfs_dedup_prefetch' value to '0' 2014-09-04 09:50:45 -07:00
dmu_diff.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
dmu_object.c Illumos 3693 - restore_object uses at least two transactions to restore an object 2014-10-21 15:26:50 -07:00
dmu_objset.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
dmu_send.c Illumos 5162 - zfs recv should use loaned arc buffer to avoid copy 2014-10-21 16:32:11 -07:00
dmu_traverse.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
dmu_tx.c Improve reporting of tx assignment wait times 2014-03-04 12:22:24 -08:00
dmu_zfetch.c Use enum type(zfetch_dirn_t) instead 2014-01-23 12:56:33 -08:00
dmu.c Illumos 5162 - zfs recv should use loaned arc buffer to avoid copy 2014-10-21 16:32:11 -07:00
dnode_sync.c Illumos 5117 - spacemap reallocation can cause corruption 2014-09-08 09:42:39 -07:00
dnode.c Illumos 5139 - SEEK_HOLE failed to report a hole at end of file 2014-09-23 10:38:45 -07:00
dsl_bookmark.c Illumos 4368, 4369. 2014-07-29 10:55:29 -07:00
dsl_dataset.c Illumos 5150 - zfs clone of a defer_destroy snapshot causes strangeness 2014-10-21 15:26:58 -07:00
dsl_deadlist.c
dsl_deleg.c
dsl_destroy.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
dsl_dir.c Illumos 4171, 4172 2014-07-25 16:40:07 -07:00
dsl_pool.c Illumos 4958 zdb trips assert on pools with ashift >= 0xe 2014-10-23 15:30:32 -07:00
dsl_prop.c Check the dataset type more rigorously when fetching properties. 2014-05-06 10:41:46 -07:00
dsl_scan.c Prevent ZFS leaking pool free space 2014-11-17 11:35:38 -08:00
dsl_synctask.c Export symbols dsl_sync_task{_nowait} 2014-03-07 10:01:36 -08:00
dsl_userhold.c Illumos 4757, 4913 2014-08-01 14:28:05 -07:00
fm.c Fixed memory leaks in zevent handling 2014-08-20 10:45:16 -07:00
gzip.c
lz4.c Illumos #4936 fix potential overflow in lz4 2014-07-01 14:10:47 -07:00
lzjb.c
Makefile.in Swap DTRACE_PROBE* with Linux tracepoints 2014-11-17 11:13:55 -08:00
metaslab.c Illumos 5213 - panic in metaslab_init due to space_map_open returning ENXIO 2014-11-14 15:37:45 -08:00
range_tree.c Illumos 4976-4984 - metaslab improvements 2014-08-18 08:40:49 -07:00
refcount.c
rrwlock.c
sa.c Calculate header size correctly in sa_find_sizes() 2014-05-19 11:55:50 -07:00
sha256.c
spa_boot.c
spa_config.c Update utsname support 2014-10-17 14:58:57 -07:00
spa_errlog.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
spa_history.c Update utsname support 2014-10-17 14:58:57 -07:00
spa_misc.c Swap DTRACE_PROBE* with Linux tracepoints 2014-11-17 11:13:55 -08:00
spa_stats.c Fix improper null-byte termination handling 2014-11-17 15:28:59 -08:00
spa.c Illumos 4924 - LZ4 Compression for metadata 2014-10-20 16:17:49 -07:00
space_map.c Fix dprintf format specifiers 2014-11-17 11:13:45 -08:00
space_reftree.c Illumos #4101, #4102, #4103, #4105, #4106 2014-07-22 09:39:16 -07:00
trace.c Swap DTRACE_PROBE* with Linux tracepoints 2014-11-17 11:13:55 -08:00
txg.c Illumos 4753 - increase number of outstanding async writes when sync task is waiting 2014-09-23 13:50:55 -07:00
uberblock.c
unique.c
vdev_cache.c Illumos 4370, 4371 2014-07-28 14:29:58 -07:00
vdev_disk.c Illumos #4374 2014-07-30 09:20:35 -07:00
vdev_file.c Honor zfs_nocacheflush for file vdevs 2014-05-19 13:30:48 -07:00
vdev_label.c Fix function call with uninitialized value in vdev_inuse 2014-09-23 10:32:45 -07:00
vdev_mirror.c Handle NULL mirror child vdev 2014-10-17 14:59:05 -07:00
vdev_missing.c
vdev_queue.c Illumos 4753 - increase number of outstanding async writes when sync task is waiting 2014-09-23 13:50:55 -07:00
vdev_raidz.c
vdev_root.c
vdev.c Illumos 5213 - panic in metaslab_init due to space_map_open returning ENXIO 2014-11-14 15:37:45 -08:00
zap_leaf.c Illumos #4374 2014-07-30 09:20:35 -07:00
zap_micro.c Add object type checking to zap_lockdir() 2014-09-08 09:15:38 -07:00
zap.c Fix dprintf format specifiers 2014-11-17 11:13:45 -08:00
zfeature_common.c Illumos 4924 - LZ4 Compression for metadata 2014-10-20 16:17:49 -07:00
zfeature.c Illumos 4370, 4371 2014-07-28 14:29:58 -07:00
zfs_acl.c Don't perform ACL-to-mode translation on empty ACL 2014-10-21 09:23:27 -07:00
zfs_byteswap.c
zfs_ctldir.c Illumos 4368, 4369. 2014-07-29 10:55:29 -07:00
zfs_debug.c Swap DTRACE_PROBE* with Linux tracepoints 2014-11-17 11:13:55 -08:00
zfs_dir.c Revert "Revert "Revert "Fix unlink/xattr deadlock""" 2014-08-11 16:12:36 -07:00
zfs_fm.c Fixed memory leaks in zevent handling 2014-08-20 10:45:16 -07:00
zfs_fuid.c
zfs_ioctl.c Swap DTRACE_PROBE* with Linux tracepoints 2014-11-17 11:13:55 -08:00
zfs_log.c
zfs_onexit.c
zfs_replay.c Linux AIO Support 2014-09-05 15:11:43 -07:00
zfs_rlock.c
zfs_sa.c
zfs_vfsops.c Fix dprintf format specifiers 2014-11-17 11:13:45 -08:00
zfs_vnops.c Remove checks for mandatory locks 2014-10-22 11:06:53 -07:00
zfs_znode.c Remove checks for mandatory locks 2014-10-22 11:06:53 -07:00
zil.c Export symbols for ZIL interface 2014-11-14 14:39:43 -08:00
zio_checksum.c Illumos 4757, 4913 2014-08-01 14:28:05 -07:00
zio_compress.c Illumos 4757, 4913 2014-08-01 14:28:05 -07:00
zio_inject.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
zio.c Illumos 4958 zdb trips assert on pools with ashift >= 0xe 2014-10-23 15:30:32 -07:00
zle.c
zpl_ctldir.c
zpl_export.c
zpl_file.c Suppress AIO kmem warnings 2014-10-20 16:10:25 -07:00
zpl_inode.c
zpl_super.c Remove shrink_dcache_memory() and shrink_icache_memory() 2014-10-17 14:58:50 -07:00
zpl_xattr.c Linux AIO Support 2014-09-05 15:11:43 -07:00
zrlock.c
zvol.c Use long holds in zvol_set_volsize() 2014-01-14 14:46:12 -08:00