15 Star 2 Fork 68

src-openEuler/util-linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
2.36-login-lastlog-create.patch
Add-check-to-resolve-uname26-version-test-failed.patch
SKIPPED-no-root-permissions-test.patch
adjtime
backport-CVE-2021-3995.patch
backport-CVE-2021-3996.patch
backport-CVE-2022-0563.patch
backport-CVE-2024-28085.patch
backport-Fix-integer-overflow-for-alpha-like-linux.patch
backport-Fix-memory-leaks-in-the-chcpu.patch
backport-Forward-value-of-sector_size-instead-of-its-addr...
backport-Maybe-there-is-a-little-mistake-in-do_taskset-fu...
backport-add-return-in-supam_conv-function.patch
backport-blkid-fix-call-to-err_exclusive_options.patch
backport-cal-avoid-out-of-bound-write.patch
backport-cfdisk-add-hint-about-labels-for-bootable-flag.p...
backport-column-don-t-require-column-name-for-JSON.patch
backport-column-fix-buffer-overflow-when-l-specified.patch
backport-column-fix-greedy-mode-on-l.patch
backport-column-fix-l.patch
backport-column-fix-memory-leak.patch
backport-dmesg-fix-since-and-until.patch
backport-fdisk-fix-output-option-parsing.patch
backport-fflush-stdout-before-reading-from-stdin.patch
backport-fix-by-ignoring-EINVAL-on-remount-of-proc.patch
backport-flush-stdout-before-reading-stdin-and-fix-uninit...
backport-fsck-Processes-may-kill-other-processes.patch
backport-fstat-dir-itself.patch
backport-hexdump-check-blocksize-when-display-data.patch
backport-hexdump-parse-handle-truncated-format-pattern.patch
backport-include-c.h-add-helpers-for-unaligned-structure-...
backport-ipc_msg_get_limits-always-initialize-memory.patch
backport-iso9660.h-avoid-undefined-signed-integer-shift.p...
backport-iso9660.h-use-more-correct-function-types.patch
backport-last-avoid-out-of-bounds-array-access.patch
backport-last-don-t-assume-zero-terminate-strings.patch
backport-ldattach-don-t-call-exit-from-signal-handler.patch
backport-ldattach-fix-intro-command-and-pause.patch
backport-lib-allow-safe_getenv-to-work-for-non-root-users...
backport-lib-caputils-fix-integer-handling-issues-coverit...
backport-lib-cpuset-exit-early-from-cpulist_parse.patch
backport-lib-pager-fix-signal-safety-issues.patch
backport-lib-path-fix-possible-out-of-boundary-access.patch
backport-lib-path-make-path-use-more-robust-coverity-scan...
backport-lib-path-make-ul_path_read_buffer-more-robust-co...
backport-lib-strutils-improve-strtoul_or_err-for-negative...
backport-libblkid-Check-offset-in-LUKS2-header.patch
backport-libblkid-avoid-aligning-out-of-probing-area.patch
backport-libblkid-avoid-buffer-overflow-in-ocfs-superbloc...
backport-libblkid-avoid-memory-leak-of-cachefile-path.patch
backport-libblkid-bsd-fix-buffer-pointer-use-fuzzing.patch
backport-libblkid-check-fsync-return-code.patch
backport-libblkid-cleanup-indentation.patch
backport-libblkid-copy-BLKID_PARTS_FORCE_GPT-to-whole-dis...
backport-libblkid-don-t-mark-cache-as-probed-if-sys-not-a...
backport-libblkid-drbd-reduce-false-positive.patch
backport-libblkid-drbd-validate-zero-padding.patch
backport-libblkid-exfat-fix-divide-by-zero-coverity-scan....
backport-libblkid-fix-jmicron-checksum-and-LE-to-CPU.patch
backport-libblkid-fix-misaligned-address-in-probe_exfat.p...
backport-libblkid-hfs-fix-label-use-fuzzing.patch
backport-libblkid-hfs-fix-make-sure-buffer-is-large-enoug...
backport-libblkid-hfsplus-reduce-false-positive.patch
backport-libblkid-jfs-avoid-undefined-shift.patch
backport-libblkid-mac-make-sure-block-size-is-large-enoug...
backport-libblkid-make-blkid_free_probe-more-robust.patch
backport-libblkid-ntfs-validate-that-sector_size-is-a-pow...
backport-libblkid-nvidia_raid-validate-checksum.patch
backport-libblkid-nvidia_raid-verify-superblock-size.patch
backport-libblkid-probe-fix-size-and-offset-overflows-fuz...
backport-libblkid-probe-read-data-in-chunks.patch
backport-libblkid-reset-errno-before-calling-probefuncs.p...
backport-libblkid-src-topology-dm-close-redundant-write-f...
backport-libblkid-topology-init-variables-for-DM.patch
backport-libblkid-use-checksum-for-jmicron.patch
backport-libfdisk-Fix-randomly-generated-GPT-UUID-s.patch
backport-libfdisk-check-calloc-return-gcc-analyzer.patch
backport-libfdisk-dereference-of-possibly-NULL-gcc-analyz...
backport-libfdisk-sun-properly-initialize-partition-data....
backport-libmount-all-continue-although-proc-is-not-mount...
backport-libmount-fix-possible-NULL-dereference-coverity-...
backport-libmount-fix-possible-memory-leak-in-mnt_optstr_...
backport-libmount-improve-mnt_table_next_child_fs.patch
backport-libsmartcols-drop-spourious-newline-in-between-s...
backport-libsmartcols-flush-correct-stream.patch
backport-libsmartcols-only-recognize-closed-object-as-fin...
backport-llib-pty-session-split-PTY-and-signalfd-setup.patch
backport-logger-always-update-header-when-read-from-stdin...
backport-logger-fix-prio-prefix-doesn-t-use-priority-defa...
backport-logger-initialize-socket-credentials-contol-unio...
backport-login-Restore-tty-size-after-calling-vhangup.patch
backport-login-never-send-signals-to-init.patch
backport-login-prevent-undefined-ioctl-and-tcsetattr-call...
backport-login-su-pam_end-compliance.patch
backport-login-use-correct-terminal-fd-during-setup.patch
backport-loopdev-set-block_size-when-using-LOOP_CONFIGURE...
backport-losetup-fix-memory-leak-asan.patch
backport-lsblk-fix-endless-loop-if-device-specified-more-...
backport-lscpu-don-t-use-NULL-sharedmap.patch
backport-lscpu-fix-p-output-all-caches-delimiter.patch
backport-lscpu-use-topology-maps-in-more-robust-way.patch
backport-lsipc-fix-semaphore-USED-counter.patch
backport-lslocks-fix-buffer-overflow.patch
backport-lslocks-fix-maj-min-scanf.patch
backport-lslogins-fix-free-invalid-pointer.patch
backport-lslogins-fix-realloc-loop-allocation-size.patch
backport-lslogins-improve-prefixes-interpretation.patch
backport-lsns-fix-the-memory-leak.patch
backport-mcookie-fix-infinite-loop-when-use-f.patch
backport-mkswap-do-not-use-uninitialized-stack-value.patch
backport-more-avoid-out-of-bound-access.patch
backport-more-exit-if-POLLERR-and-POLLHUP-on-stdin-is-rec...
backport-more-fix-poll-use.patch
backport-partx-remove-memory-leak-to-make-scanners-happy-...
backport-script-fix-passing-args-to-execlp.patch
backport-script-fix-use-of-utempter.patch
backport-scriptlive-fix-argv-0-for-execlp.patch
backport-scriptreplay-support-ctrl-s-and-ctrl-g.patch
backport-sfdisk-fix-typo-in-move-data-when-check-partitio...
backport-sfdisk-write-empty-label-also-when-only-ignored-...
backport-su-bash-completion-offer-usernames-rather-than-f...
backport-sulogin-fix-KDGKBMODE-ifdef.patch
backport-sulogin-ignore-none-existing-console-devices.patch
backport-sys-utils-lscpu-Unblock-SIGSEGV-before-vmware_bd...
backport-sysfs-fallback-for-partitions-not-including-pare...
backport-unshare-Move-implementation-of-keep-caps-option-...
backport-vipw-flush-stdout-before-getting-answer.patch
backport-wall-convert-homebrew-buffering-to-open_memstrea...
backport-wall-fix-calloc-cal-Werror-calloc-transposed-arg...
backport-wall-use-fputs_careful.patch
backport-wdctl-mark-flags-field-as-unsigned-long.patch
backport-wrap-return-in-else-directive-to-avoid-dead-code...
backport-write-correctly-handle-wide-characters.patch
fix-size-use-for-stdin.patch
realloc-buffer-when-header-size-changed.patch
segmentation-fault-on-invalid-unicode-input-passed-to-s-o...
util-linux-2.37.2.tar.xz
util-linux-60-raw.rules
util-linux-Add-sw64-architecture.patch
util-linux-chsh-chfn.pamd
util-linux-login.pamd
util-linux-remote.pamd
util-linux-runuser-l.pamd
util-linux-runuser.pamd
util-linux-su-l.pamd
util-linux-su.pamd
util-linux.spec
util-linux.yaml
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-column-fix-buffer-overflow-when-l-specified.patch 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
zhangyao2022 提交于 2年前 . sync community patches
From 4aacf57da1e41643fa789d3ffe848d50029a62de Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 4 Aug 2022 10:10:19 +0200
Subject: [PATCH] column: fix buffer overflow when -l specified
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
$ printf 'a b c\n1 2 3\n' | column -s : -t -o '-' -l2
a b c-ġ
1 2 3-
Signed-off-by: Karel Zak <kzak@redhat.com>
---
text-utils/column.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/text-utils/column.c b/text-utils/column.c
index a4ba24dcd..3d068b08d 100644
--- a/text-utils/column.c
+++ b/text-utils/column.c
@@ -507,17 +507,23 @@ static void modify_table(struct column_control *ctl)
static int add_line_to_table(struct column_control *ctl, wchar_t *wcs0)
{
wchar_t *wcdata, *sv = NULL, *wcs = wcs0;
- size_t n = 0, nchars = 0;
+ size_t n = 0, nchars = 0, len;
struct libscols_line *ln = NULL;
if (!ctl->tab)
init_table(ctl);
+
+ len = wcslen(wcs0);
+
do {
char *data;
- if (ctl->maxncols && n + 1 == ctl->maxncols)
- wcdata = wcs0 + nchars;
- else
+ if (ctl->maxncols && n + 1 == ctl->maxncols) {
+ if (nchars < len)
+ wcdata = wcs0 + nchars;
+ else
+ wcdata = NULL;
+ } else
wcdata = local_wcstok(ctl, wcs, &sv);
if (!wcdata)
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/util-linux.git
git@gitee.com:src-openeuler/util-linux.git
src-openeuler
util-linux
util-linux
openEuler-22.03-LTS

搜索帮助