[OpenWrt-Devel] [PATCH procd] system: support passing "options" to the "sysupgrade" ubus method

Rafał Miłecki zajec5 at gmail.com
Thu Aug 22 07:39:49 EDT 2019


On Sat, 17 Aug 2019 at 12:31, Jo-Philipp Wich <jo at mein.io> wrote:
> > [...]
> > +
> > +     blobmsg_for_each_attr(option, options, rem) {
> > +             const char *prefix = "UPGRADE_OPT_";
> > +             char *name = malloc(strlen(prefix) + strlen(blobmsg_name(option)));
> > +             char value[11];
> > +             char *c;
> > +             int tmp;
> > +
> > +             if (!name) {
> > +                     continue;
> > +             }
> > +             sprintf(name, "%s%s", prefix, blobmsg_name(option));
> > +             for (c = name + strlen(prefix); *c; c++) {
>
> I'd propose some more sanity checking here:

Pushed with your checks, thanks!

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list