Home
last modified time | relevance | path

Searched hist:"9 dfdbd9f0c69c6c8005bc41ac602c27023492ee8" (Results 1 – 3 of 3) sorted by relevance

/openbmc/u-boot/test/env/
H A Dhashtable.c9dfdbd9f0c69c6c8005bc41ac602c27023492ee8 Wed Jan 30 04:39:54 CST 2019 Roman Kapl <rka@sysgo.com> hashtable: fix environment variable corruption

Only first previously deleted entry was recognized, leading hsearch_r
to think that there was no previously deleted entry. It then conluded
that a free entry was found, even if there were no free entries and it
overwrote a random entry.

This patch makes sure all deleted or free entries are always found and
also introduces constants for the 0 and -1 numbers. Unit tests to excersise a
simple hash table usage and catch the corruption were added.

To trash your environment, simply run this loop:

setenv i 0
while true; do
setenv v_$i $i
setenv v_$i
setexpr i $i + 1
done

Signed-off-by: Roman Kapl <rka@sysgo.com>
H A DMakefilediff 9dfdbd9f0c69c6c8005bc41ac602c27023492ee8 Wed Jan 30 04:39:54 CST 2019 Roman Kapl <rka@sysgo.com> hashtable: fix environment variable corruption

Only first previously deleted entry was recognized, leading hsearch_r
to think that there was no previously deleted entry. It then conluded
that a free entry was found, even if there were no free entries and it
overwrote a random entry.

This patch makes sure all deleted or free entries are always found and
also introduces constants for the 0 and -1 numbers. Unit tests to excersise a
simple hash table usage and catch the corruption were added.

To trash your environment, simply run this loop:

setenv i 0
while true; do
setenv v_$i $i
setenv v_$i
setexpr i $i + 1
done

Signed-off-by: Roman Kapl <rka@sysgo.com>
/openbmc/u-boot/lib/
H A Dhashtable.cdiff 9dfdbd9f0c69c6c8005bc41ac602c27023492ee8 Wed Jan 30 04:39:54 CST 2019 Roman Kapl <rka@sysgo.com> hashtable: fix environment variable corruption

Only first previously deleted entry was recognized, leading hsearch_r
to think that there was no previously deleted entry. It then conluded
that a free entry was found, even if there were no free entries and it
overwrote a random entry.

This patch makes sure all deleted or free entries are always found and
also introduces constants for the 0 and -1 numbers. Unit tests to excersise a
simple hash table usage and catch the corruption were added.

To trash your environment, simply run this loop:

setenv i 0
while true; do
setenv v_$i $i
setenv v_$i
setexpr i $i + 1
done

Signed-off-by: Roman Kapl <rka@sysgo.com>