--- /dev/null
+--- busybox-1.22.1/shell/ash.c
++++ busybox-1.22.1-ash/shell/ash.c
+@@ -13014,7 +13014,7 @@ init(void)
+ setvar2("PPID", utoa(getppid()));
+ #if ENABLE_ASH_BASH_COMPAT
+ p = lookupvar("SHLVL");
+- setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1));
++ setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT);
+ #endif
+ p = lookupvar("PWD");
+ if (p) {
+--- busybox-1.22.1/libbb/time.c
++++ busybox-1.22.1-date/libbb/time.c
+@@ -68,15 +68,23 @@ void FAST_FUNC parse_datestr(const char
+ /* else end != NUL and we error out */
+ }
+ } else
+- /* yyyy-mm-dd HH */
+- if (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
++ if (strchr(date_str, '-')
++ /* Why strchr('-') check?
++ * sscanf below will trash ptm->tm_year, this breaks
++ * if parse_str is "10101010" (iow, "MMddhhmm" form)
++ * because we destroy year. Do these sscanf
++ * only if we saw a dash in parse_str.
++ */
++ /* yyyy-mm-dd HH */
++ && (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
+ &ptm->tm_mon, &ptm->tm_mday,
+ &ptm->tm_hour,
+ &end) >= 4
+- /* yyyy-mm-dd */
+- || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
++ /* yyyy-mm-dd */
++ || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
+ &ptm->tm_mon, &ptm->tm_mday,
+ &end) >= 3
++ )
+ ) {
+ ptm->tm_year -= 1900; /* Adjust years */
+ ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
+--- busybox-1.22.1/networking/libiproute/iplink.c
++++ busybox-1.22.1-iplink/networking/libiproute/iplink.c
+@@ -31,6 +31,16 @@
+ #ifndef IFLA_LINKINFO
+ # define IFLA_LINKINFO 18
+ # define IFLA_INFO_KIND 1
++# define IFLA_INFO_DATA 2
++#endif
++
++#ifndef IFLA_VLAN_MAX
++# define IFLA_VLAN_ID 1
++# define IFLA_VLAN_FLAGS 2
++struct ifla_vlan_flags {
++ uint32_t flags;
++ uint32_t mask;
++};
+ #endif
+
+ /* taken from linux/sockios.h */
+--- busybox-1.22.1/networking/nc_bloaty.c
++++ busybox-1.22.1-nc/networking/nc_bloaty.c
+@@ -175,9 +175,9 @@ enum {
+ OPT_w = (1 << 5),
+ OPT_l = (1 << 6) * ENABLE_NC_SERVER,
+ OPT_k = (1 << 7) * ENABLE_NC_SERVER,
+- OPT_i = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+- OPT_o = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+- OPT_z = (1 << (9+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
++ OPT_i = (1 << (6+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
++ OPT_o = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
++ OPT_z = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+ };
+
+ #define o_nflag (option_mask32 & OPT_n)
+--- a/archival/libarchive/liblzo.h
++++ b/archival/libarchive/liblzo.h
+@@ -76,11 +76,13 @@
+ # define TEST_IP (ip < ip_end)
+ # define NEED_IP(x) \
+ if ((unsigned)(ip_end - ip) < (unsigned)(x)) goto input_overrun
++# define TEST_IV(x) if ((x) > (unsigned)0 - (511)) goto input_overrun
+
+ # undef TEST_OP /* don't need both of the tests here */
+ # define TEST_OP 1
+ # define NEED_OP(x) \
+ if ((unsigned)(op_end - op) < (unsigned)(x)) goto output_overrun
++# define TEST_OV(x) if ((x) > (unsigned)0 - (511)) goto output_overrun
+
+ #define HAVE_ANY_OP 1
+
+--- a/archival/libarchive/lzo1x_d.c
++++ b/archival/libarchive/lzo1x_d.c
+@@ -92,6 +92,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
+ ip++;
+ NEED_IP(1);
+ }
++ TEST_IV(t);
+ t += 15 + *ip++;
+ }
+ /* copy literals */
+@@ -224,6 +225,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
+ ip++;
+ NEED_IP(1);
+ }
++ TEST_IV(t);
+ t += 31 + *ip++;
+ }
+ #if defined(COPY_DICT)
+@@ -265,6 +267,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
+ ip++;
+ NEED_IP(1);
+ }
++ TEST_IV(t);
+ t += 7 + *ip++;
+ }
+ #if defined(COPY_DICT)
+--- a/archival/libarchive/open_transformer.c
++++ b/archival/libarchive/open_transformer.c
+@@ -182,27 +182,26 @@ int FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_detected)
+
+ int FAST_FUNC open_zipped(const char *fname)
+ {
+- char *sfx;
+ int fd;
+
+ fd = open(fname, O_RDONLY);
+ if (fd < 0)
+ return fd;
+
+- sfx = strrchr(fname, '.');
+- if (sfx) {
+- sfx++;
+- if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
+- /* .lzma has no header/signature, just trust it */
++ if (ENABLE_FEATURE_SEAMLESS_LZMA) {
++ /* .lzma has no header/signature, can only detect it by extension */
++ char *sfx = strrchr(fname, '.');
++ if (sfx && strcmp(sfx+1, "lzma") == 0) {
+ open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
+- else
+- if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
+- || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
+- || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
+- ) {
+- setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
++ return fd;
+ }
+ }
++ if ((ENABLE_FEATURE_SEAMLESS_GZ)
++ || (ENABLE_FEATURE_SEAMLESS_BZ2)
++ || (ENABLE_FEATURE_SEAMLESS_XZ)
++ ) {
++ setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
++ }
+
+ return fd;
+ }
+