[SLOF] [PATCH 0/2] Improve stack usage in libnvram

Thomas Huth thuth at redhat.com
Tue Dec 1 20:06:10 AEDT 2015

Here's the rework of the patch that improves stack usage in libnvram.
I've split it in two parts now:
First patch reworks the functions from envvar.c. These functions do
not really rely on the NUL-terminated strings, so I've changed them
now to deal with the Forth strings directly instead - no more
temporary buffers needed here!
The second patch contains the fix for get_partition. Here I kept the
separate wrapper function get_partition_fs() with the temporary buffer,
since this was the easier and more readable way to fix this issue there
(get_partition() is used all over the place, so the patch would also
get much bigger otherwise).

Thomas Huth (2):
  Improve stack usage in libnvram environment variable code
  Improve stack usage with libnvram get_partition function

 lib/libnvram/envvar.c      | 41 ++++++++++++++++----------------
 lib/libnvram/libnvram.code | 58 +++++++++++++++++++++-------------------------
 lib/libnvram/nvram.c       | 11 +++++++++
 lib/libnvram/nvram.h       |  9 +++----
 4 files changed, 62 insertions(+), 57 deletions(-)


More information about the SLOF mailing list