diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-06-08 02:02:24 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-06-08 02:02:24 -0500 |
commit | fd2bb2f751c13b3c0c002b8e012810902b9da364 (patch) | |
tree | 17b2e38c966c9f96cfa568c1f572261a289590e6 /system/busybox/top-buffer-overflow.patch | |
parent | b0a5136bf3326ba38b360be288d06f9a27f2a4d2 (diff) | |
download | packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.gz packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.bz2 packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.xz packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.zip |
harmony -> system
Diffstat (limited to 'system/busybox/top-buffer-overflow.patch')
-rw-r--r-- | system/busybox/top-buffer-overflow.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/system/busybox/top-buffer-overflow.patch b/system/busybox/top-buffer-overflow.patch new file mode 100644 index 000000000..14b23c648 --- /dev/null +++ b/system/busybox/top-buffer-overflow.patch @@ -0,0 +1,20 @@ +--- busybox-1.27.0.orig/procps/top.c ++++ busybox-1.27.0/procps/top.c +@@ -694,10 +694,14 @@ + CALC_STAT(pcpu, (s->pcpu*pcpu_scale + pcpu_half) >> pcpu_shift); + #endif + +- if (s->vsz >= 100000) +- sprintf(vsz_str_buf, "%6ldm", s->vsz/1024); ++ if ((s->vsz / (1024 * 1024)) >= 100000) ++ snprintf(vsz_str_buf, sizeof(vsz_str_buf), "%6ldt", s->vsz/(1024 * 1024 * 1024)); ++ else if ((s->vsz / 1024) >= 100000) ++ snprintf(vsz_str_buf, sizeof(vsz_str_buf), "%6ldg", s->vsz/(1024 * 1024)); ++ else if (s->vsz >= 100000) ++ snprintf(vsz_str_buf, sizeof(vsz_str_buf), "%6ldm", s->vsz/1024); + else +- sprintf(vsz_str_buf, "%7lu", s->vsz); ++ snprintf(vsz_str_buf, sizeof(vsz_str_buf), "%7lu", s->vsz); + /* PID PPID USER STAT VSZ %VSZ [%CPU] COMMAND */ + col = snprintf(line_buf, scr_width, + "\n" "%5u%6u %-8.8s %s%s" FMT |