浏览代码

Both _dl_simple_ltoa and _dl_simple_ltoahex use buffers of size 21,
but we were feeding them strings that were just 13 bytes long...
Thanks to spudmonkey@racsa.co.cr for noticing!
-Erik

Eric Andersen 24 年之前
父节点
当前提交
34eeb65d14
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ldso/ldso/ldso.c

+ 2 - 2
ldso/ldso/ldso.c

@@ -1179,7 +1179,7 @@ void _dl_dprintf(int fd, const char *fmt, ...)
 		case 'i':
 		case 'd':
 		    {
-			char tmp[13];
+			char tmp[22];
 			num = va_arg(args, int);
 			string = _dl_simple_ltoa(tmp, num);
 			_dl_write(fd, string, _dl_strlen(string));
@@ -1188,7 +1188,7 @@ void _dl_dprintf(int fd, const char *fmt, ...)
 		case 'x':
 		case 'X':
 		    {
-			char tmp[13];
+			char tmp[22];
 			num = va_arg(args, int);
 			string = _dl_simple_ltoahex(tmp, num);
 			_dl_write(fd, string, _dl_strlen(string));