[PATCH v2 23/30] discover/powerpc: Switch to new param_list

Geoff Levand geoff at infradead.org
Tue Aug 7 02:40:18 AEST 2018


Hi Sam,

On 08/05/2018 10:42 PM, Samuel Mendoza-Jonas wrote:
> On Thu, 2018-08-02 at 17:29 +0000, Geoff Levand wrote:
> 
> I noticed this while testing, since namelen doesn't get passed to
> param_list_set() it accidentally uses the whole string, eg:
> 	param_list_set: Created: auto-boot?=false:false
> 	param_list_set: Created: petitboot,bootdevs=network any :network any
> 
> This could just be fixed up by doing..
> 
> 		*value = '\0';
> 
> Which I can fixup, does that sound right?

Yes, it seems like that is needed.  param_list expects that the
name and value entries are zero terminated strings.  Maybe we
can put a comment to that effect in param_list.h:

--- a/lib/param_list/param_list.h
+++ b/lib/param_list/param_list.h
@@ -5,6 +5,7 @@
 
 #include <list/list.h>
 
+/* struct param - Name/value pairs of zero terminated strings. */
 struct param {
 	char *name;
 	char *value;





More information about the Petitboot mailing list