diff mbox series

libuboot_env_store: fix env double-null termination

Message ID 20201013123632.12061-1-sami.hartikainen@teleste.com
State New
Headers show
Series libuboot_env_store: fix env double-null termination | expand

Commit Message

Sami Hartikainen Oct. 13, 2020, 12:36 p.m. UTC
Environment lines are terminated with a single null byte, followed
by another null byte to terminate the env itself. Fix termination
in case where flags need saving.

Signed-off-by: Sami Hartikainen <sami.hartikainen@teleste.com>
---
 src/uboot_env.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/src/uboot_env.c b/src/uboot_env.c
index c9a900f..756a5fb 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -898,6 +898,7 @@  int libuboot_env_store(struct uboot_ctx *ctx)
 				first = false;
 			}
 		}
+		buf++;
 	}
 	*buf++ = '\0';