<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/lib/hashtable.c, branch v2019.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>hashtable: fix length calculation in hexport_r</title>
<updated>2018-12-15T16:49:19+00:00</updated>
<author>
<name>AKASHI Takahiro</name>
<email>takahiro.akashi@linaro.org</email>
</author>
<published>2018-12-14T09:42:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4bca32497c09ef53ad669dfa4c413c00321ad7ca'/>
<id>4bca32497c09ef53ad669dfa4c413c00321ad7ca</id>
<content type='text'>
The commit below incorrectly fixed hexport_r();
 &gt;	size = totlen + 1;
One extra byte is necessary to NULL-terminate a whole buffer, "resp."

Fixes: f1b20acb4a03 ("hashtable: Fix length calculation in hexport_r")
Signed-off-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The commit below incorrectly fixed hexport_r();
 &gt;	size = totlen + 1;
One extra byte is necessary to NULL-terminate a whole buffer, "resp."

Fixes: f1b20acb4a03 ("hashtable: Fix length calculation in hexport_r")
Signed-off-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hashtable: Fix length calculation in hexport_r</title>
<updated>2018-07-24T13:25:23+00:00</updated>
<author>
<name>Zubair Lutfullah Kakakhel</name>
<email>zubair@resin.io</email>
</author>
<published>2018-07-17T18:25:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f1b20acb4a03fc6ef5ebff18293287506348955d'/>
<id>f1b20acb4a03fc6ef5ebff18293287506348955d</id>
<content type='text'>
The length returned by hexport_r has a few redundant characters.
This appears as NULL characters at the end so seems harmless.

Remove the surplus counts in two places

totlen += strlen(ep-&gt;key) + 2;
I'm guessing the +2 here is for = and sep char. But there is another
totlen += 2; line that does that.

size = totletn + 1;
Doesn't make sense and isn't justified with any comment.

Signed-off-by: Zubair Lutfullah Kakakhel &lt;zubair@resin.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The length returned by hexport_r has a few redundant characters.
This appears as NULL characters at the end so seems harmless.

Remove the surplus counts in two places

totlen += strlen(ep-&gt;key) + 2;
I'm guessing the +2 here is for = and sep char. But there is another
totlen += 2; line that does that.

size = totletn + 1;
Doesn't make sense and isn't justified with any comment.

Signed-off-by: Zubair Lutfullah Kakakhel &lt;zubair@resin.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hashtable: do not recreate whole hash table if vars are passed to himport_r</title>
<updated>2018-07-20T19:55:09+00:00</updated>
<author>
<name>Quentin Schulz</name>
<email>quentin.schulz@bootlin.com</email>
</author>
<published>2018-07-09T17:16:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d9fc9077eb7eb5b793e5cbfb3364f15754fbb562'/>
<id>d9fc9077eb7eb5b793e5cbfb3364f15754fbb562</id>
<content type='text'>
When vars are passed to the himport_r function with H_NOCLEAR flag,
those vars will be overridden in the current environment and if one of
those vars is not in the imported environment, it'll be deleted in the
current environment whatever the flag passed to himport_r.

The H_NOCLEAR flag is used to clear the whole environment whether vars
are passed to the function or not.

This leads to incoherent behaviour. If one passes vars to himport_r
with the H_NOCLEAR flag, if a var in vars is not in the imported env,
that var will be removed from the current env.

If one passes vars to himport_r without the H_NOCLEAR flag, the whole
environment will be removed and vars will be imported from the
environment in RAM.

It makes more sense to keep the variable that is in the current
environment but not in the imported environment if the H_NOCLEAR flag is
set and remove only that variable if the H_NOCLEAR flag is not set.

Let's clear the whole environment only if H_NOCLEAR and vars are not
passed to himport_r.

Let's remove variables that are in the current environment but not in
the imported env only if the H_NOCLEAR flag is not passed.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Quentin Schulz &lt;quentin.schulz@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When vars are passed to the himport_r function with H_NOCLEAR flag,
those vars will be overridden in the current environment and if one of
those vars is not in the imported environment, it'll be deleted in the
current environment whatever the flag passed to himport_r.

The H_NOCLEAR flag is used to clear the whole environment whether vars
are passed to the function or not.

This leads to incoherent behaviour. If one passes vars to himport_r
with the H_NOCLEAR flag, if a var in vars is not in the imported env,
that var will be removed from the current env.

If one passes vars to himport_r without the H_NOCLEAR flag, the whole
environment will be removed and vars will be imported from the
environment in RAM.

It makes more sense to keep the variable that is in the current
environment but not in the imported environment if the H_NOCLEAR flag is
set and remove only that variable if the H_NOCLEAR flag is not set.

Let's clear the whole environment only if H_NOCLEAR and vars are not
passed to himport_r.

Let's remove variables that are in the current environment but not in
the imported env only if the H_NOCLEAR flag is not passed.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Quentin Schulz &lt;quentin.schulz@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>SPDX: Convert all of our single license tags to Linux Kernel style</title>
<updated>2018-05-07T13:34:12+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2018-05-06T21:58:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=83d290c56fab2d38cd1ab4c4cc7099559c1d5046'/>
<id>83d290c56fab2d38cd1ab4c4cc7099559c1d5046</id>
<content type='text'>
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spl: saveenv: adding saveenv support in SPL</title>
<updated>2016-10-08T13:33:36+00:00</updated>
<author>
<name>B, Ravi</name>
<email>ravibabu@ti.com</email>
</author>
<published>2016-09-28T09:16:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d2d9bdfcf9bdd6a39119c19c644189fccbe588cc'/>
<id>d2d9bdfcf9bdd6a39119c19c644189fccbe588cc</id>
<content type='text'>
By default saveenv option is not supported for SPL. This patch
enable the support for save environment variable for SPL build.

Enable save environment support in SPL after setenv. By default
the saveenv option is not provided in SPL, but some boards need
this support in 'Falcon' boot, where SPL need to boot from
different images based on environment variable set by OS. For
example OS may set "reboot_image" environment variable to
"recovery" inorder to boot recovery image by SPL. The SPL read
"reboot_image" and act accordingly and change the reboot_image
to default mode using setenv and save the environemnt.

Signed-off-by: Ravi Babu &lt;ravibabu@ti.com&gt;
Reviewed-by: Simon Glass &lt;sig@chromium.org&gt;

change in v1:
	- dropped SUPPORT, use CONFIG_SPL_SAVEENV
	- updates the comments in mmc_private.h
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default saveenv option is not supported for SPL. This patch
enable the support for save environment variable for SPL build.

Enable save environment support in SPL after setenv. By default
the saveenv option is not provided in SPL, but some boards need
this support in 'Falcon' boot, where SPL need to boot from
different images based on environment variable set by OS. For
example OS may set "reboot_image" environment variable to
"recovery" inorder to boot recovery image by SPL. The SPL read
"reboot_image" and act accordingly and change the reboot_image
to default mode using setenv and save the environemnt.

Signed-off-by: Ravi Babu &lt;ravibabu@ti.com&gt;
Reviewed-by: Simon Glass &lt;sig@chromium.org&gt;

change in v1:
	- dropped SUPPORT, use CONFIG_SPL_SAVEENV
	- updates the comments in mmc_private.h
</pre>
</div>
</content>
</entry>
<entry>
<title>Various, accumulated typos collected from around the tree.</title>
<updated>2016-10-07T00:57:40+00:00</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2016-09-07T18:27:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fc0b5948e0c15a3aebbe1f409665af30b3ae5ba3'/>
<id>fc0b5948e0c15a3aebbe1f409665af30b3ae5ba3</id>
<content type='text'>
Fix various misspellings of:

 * deprecated
 * partition
 * preceding,preceded
 * preparation
 * its versus it's
 * export
 * existing
 * scenario
 * redundant
 * remaining
 * value
 * architecture

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix various misspellings of:

 * deprecated
 * partition
 * preceding,preceded
 * preparation
 * its versus it's
 * export
 * existing
 * scenario
 * redundant
 * remaining
 * value
 * architecture

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hashtable: Fix compiler warning on 32-bit sandbox</title>
<updated>2016-07-25T16:05:55+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2016-07-22T15:22:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c55d02b2aca9b477dcf4c81062cc8e301d8c89d8'/>
<id>c55d02b2aca9b477dcf4c81062cc8e301d8c89d8</id>
<content type='text'>
This fixes a mismatch between the %zu format and the type used on sandbox.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a mismatch between the %zu format and the type used on sandbox.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Various, unrelated tree-wide typo fixes.</title>
<updated>2016-07-16T13:43:12+00:00</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2016-07-15T17:44:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=62a3b7dd086ef8ceba91e99cceb19704efc1b482'/>
<id>62a3b7dd086ef8ceba91e99cceb19704efc1b482</id>
<content type='text'>
    Fix a number of typos, including:

     * "compatble" -&gt; "compatible"
     * "eanbeld" -&gt; "enabled"
     * "envrionment" -&gt; "environment"
     * "FTD" -&gt; "FDT" (for "flattened device tree")
     * "ommitted" -&gt; "omitted"
     * "overriden" -&gt; "overridden"
     * "partiton" -&gt; "partition"
     * "propogate" -&gt; "propagate"
     * "resourse" -&gt; "resource"
     * "rest in piece" -&gt; "rest in peace"
     * "suport" -&gt; "support"
     * "varible" -&gt; "variable"

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    Fix a number of typos, including:

     * "compatble" -&gt; "compatible"
     * "eanbeld" -&gt; "enabled"
     * "envrionment" -&gt; "environment"
     * "FTD" -&gt; "FDT" (for "flattened device tree")
     * "ommitted" -&gt; "omitted"
     * "overriden" -&gt; "overridden"
     * "partiton" -&gt; "partition"
     * "propogate" -&gt; "propagate"
     * "resourse" -&gt; "resource"
     * "rest in piece" -&gt; "rest in peace"
     * "suport" -&gt; "support"
     * "varible" -&gt; "variable"

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: import: hashtable: Free memory allocated before exiting from himport_r()</title>
<updated>2015-09-15T19:05:13+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>l.majewski@majess.pl</email>
</author>
<published>2015-09-13T22:57:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0226d8780b3886a4acdd2d4c9731419306d470f6'/>
<id>0226d8780b3886a4acdd2d4c9731419306d470f6</id>
<content type='text'>
ithout this patch memory is not released on early exit.

Signed-off-by: Lukasz Majewski &lt;l.majewski@majess.pl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ithout this patch memory is not released on early exit.

Signed-off-by: Lukasz Majewski &lt;l.majewski@majess.pl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: import: hashtable: Prevent buffer overrun when importing environment from file</title>
<updated>2015-09-15T19:05:08+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>l.majewski@majess.pl</email>
</author>
<published>2015-09-13T22:57:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=817e48d8a2998b19dc36a77f8363b5f74bc3fa9e'/>
<id>817e48d8a2998b19dc36a77f8363b5f74bc3fa9e</id>
<content type='text'>
Lets consider following scenario:
- One uses echo -n "key=value" to define environment variable in a file (single variable)
- The file content is "key=value" without any terminating byte (e.g. 0x0a or
0x0d).
- The file is loaded to u-boot non zero'ed RAM buffer (with load command).
- Then "env import -t -r $loadaddr $filesize" is executed.
- Due to lack of proper termination byte we have classical example of buffer
  overrun.

This patch prevents from this by allocating one extra byte than size and
explicitly null terminate it.

There should be no change for normal env import operation after applying
this patch.

Signed-off-by: Lukasz Majewski &lt;l.majewski@majess.pl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lets consider following scenario:
- One uses echo -n "key=value" to define environment variable in a file (single variable)
- The file content is "key=value" without any terminating byte (e.g. 0x0a or
0x0d).
- The file is loaded to u-boot non zero'ed RAM buffer (with load command).
- Then "env import -t -r $loadaddr $filesize" is executed.
- Due to lack of proper termination byte we have classical example of buffer
  overrun.

This patch prevents from this by allocating one extra byte than size and
explicitly null terminate it.

There should be no change for normal env import operation after applying
this patch.

Signed-off-by: Lukasz Majewski &lt;l.majewski@majess.pl&gt;
</pre>
</div>
</content>
</entry>
</feed>
