Hi,
In uboot_env.c the libuboot_load_file() function is used to load and parse the default environment file passed with -f option. The issue I encountered, is that this function will read the file line by line in chunks of max LINE_LENGTH characters (to extract the environment variables from it), and if a line in the provided file exceeds this limit, the environment will be corrupted !!!
Two problems with this: firstly there is no warning that is printed. Normally the function should detect this and return error when encountered, to avoid corrupted environment. (I'll be happy to submit a patch for this)
Secondly, the value of LINE_LENGTHis set at compile time, and cannot be modified later. Maybe it could be interesting to have an additional option that goes with the -f option to specify the max line length.
If this is viewed as not a bug by the maintainer, I would suggest at least to add a warning about this limitation in the README or the usage of the cmd.
The default value for LINE_LENGTHis 1024bytes, which is defined as a macro. 1024Bcan be easily exceeded in some cases when defining scripts e.g. Recovery/Prod scripts.
Hi, In uboot_env.c the libuboot_load_file() function is used to load and parse the default environment file passed with
-f
option. The issue I encountered, is that this function will read the file line by line in chunks of maxLINE_LENGTH
characters (to extract the environment variables from it), and if a line in the provided file exceeds this limit, the environment will be corrupted !!!Two problems with this: firstly there is no warning that is printed. Normally the function should detect this and return error when encountered, to avoid corrupted environment. (I'll be happy to submit a patch for this)
Secondly, the value of
LINE_LENGTH
is set at compile time, and cannot be modified later. Maybe it could be interesting to have an additional option that goes with the -f option to specify the max line length.If this is viewed as not a bug by the maintainer, I would suggest at least to add a warning about this limitation in the README or the usage of the cmd.
The default value for
LINE_LENGTH
is1024
bytes, which is defined as a macro.1024B
can be easily exceeded in some cases when defining scripts e.g. Recovery/Prod scripts.Kind regards Abder