From: Simon Glass Date: Fri, 6 Mar 2015 20:19:02 +0000 (-0700) Subject: sandbox: Move CONFIG_SYS_VSNPRINTF to Kconfig X-Git-Tag: KARO-TX6-2015-09-18~2584 X-Git-Url: https://git.kernelconcepts.de/?a=commitdiff_plain;h=9edc1b69194f1aa7a0378ef2bdcd2de336fe0b1d;p=karo-tx-uboot.git sandbox: Move CONFIG_SYS_VSNPRINTF to Kconfig Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass --- diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b44f709253..3f1401ae4d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -7,6 +7,9 @@ config SYS_ARCH config USE_PRIVATE_LIBGCC default y +config SYS_VSNPRINTF + default y + choice prompt "Target select" diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 5a06396ecc..9fa60bdbec 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -20,3 +20,4 @@ CONFIG_USB_STORAGE=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_SANDBOX_GPIO=y +CONFIG_SYS_VSNPRINTF=y diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 5ad4761c72..f714298d54 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -48,8 +48,6 @@ #define CONFIG_CMD_FS_GENERIC #define CONFIG_CMD_MD5SUM -#define CONFIG_SYS_VSNPRINTF - #define CONFIG_CMD_GPIO #define CONFIG_CMD_GPT diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h index b378f5872f..9571c656be 100644 --- a/include/configs/x86-common.h +++ b/include/configs/x86-common.h @@ -16,7 +16,6 @@ * (easy to change) */ #define CONFIG_SHOW_BOOT_PROGRESS -#define CONFIG_SYS_VSNPRINTF #define CONFIG_ZBOOT_32 #define CONFIG_PHYSMEM #define CONFIG_DISPLAY_BOARDINFO_LATE diff --git a/lib/Kconfig b/lib/Kconfig index f3ea0555f2..4a4980996a 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -8,6 +8,9 @@ config CC_OPTIMIZE_LIBS_FOR_SPEED If unsure, say N. +config LIB_RAND + bool + config HAVE_PRIVATE_LIBGCC bool @@ -27,8 +30,14 @@ config SYS_HZ get_timer() must operate in milliseconds and this option must be set to 1000. -config LIB_RAND - bool +config SYS_VSNPRINTF + bool "Enable safe version of sprintf()" + help + Since sprintf() can overflow its buffer, it is common to use + snprintf() instead, which knows the buffer size and can avoid + overflow. However, this does increase code size slightly (for + Thumb-2, about 420 bytes). Enable this option for safety when + using sprintf() with data you do not control. source lib/rsa/Kconfig