summaryrefslogtreecommitdiff
path: root/user/grub/0005-vsnprintf.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2023-10-01 03:44:11 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2023-10-03 21:56:52 -0500
commit8b868f32f7e1b57c90da65157ea59eb6ce337cc9 (patch)
tree3659db750a529d3e7abf0bc2c4f1fdbb3f0886af /user/grub/0005-vsnprintf.patch
parent2c9ea8d0ea3c4510b5a4c9314c84c4444c933726 (diff)
downloadpackages-8b868f32f7e1b57c90da65157ea59eb6ce337cc9.tar.gz
packages-8b868f32f7e1b57c90da65157ea59eb6ce337cc9.tar.bz2
packages-8b868f32f7e1b57c90da65157ea59eb6ce337cc9.tar.xz
packages-8b868f32f7e1b57c90da65157ea59eb6ce337cc9.zip
user/grub: Update to 2.12_rc1
Fixes: #1065, #1066, #1073
Diffstat (limited to 'user/grub/0005-vsnprintf.patch')
-rw-r--r--user/grub/0005-vsnprintf.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/user/grub/0005-vsnprintf.patch b/user/grub/0005-vsnprintf.patch
new file mode 100644
index 000000000..88c3e0f09
--- /dev/null
+++ b/user/grub/0005-vsnprintf.patch
@@ -0,0 +1,35 @@
+From 14c95e57fddb6c826bee7755232de62efc8eb45b Mon Sep 17 00:00:00 2001
+From: Glenn Washburn <development@efficientek.com>
+Date: Fri, 18 Aug 2023 12:15:27 -0500
+Subject: kern/misc: Make grub_vsnprintf() C99/POSIX conformant
+
+To comply with C99 and POSIX standards, snprintf() should return the
+number of bytes that would be written to the string (excluding the
+terminating NUL byte) if the buffer size was big enough. Before this
+change, the return value was the minimum of the standard return and the
+length of the buffer. Rarely is the return value of grub_snprintf() or
+grub_vsnprintf() used with current code, and the few places where it is
+used do not need to be changed.
+
+Signed-off-by: Glenn Washburn <development@efficientek.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ grub-core/kern/misc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
+index 2890aad..b57249a 100644
+--- a/grub-core/kern/misc.c
++++ b/grub-core/kern/misc.c
+@@ -1201,7 +1201,7 @@ grub_vsnprintf (char *str, grub_size_t n, const char *fmt, va_list ap)
+
+ free_printf_args (&args);
+
+- return ret < n ? ret : n;
++ return ret;
+ }
+
+ int
+--
+cgit v1.1
+