src/bundle: protect usage of g_strndup with strlen()
src/bundle: protect usage of g_strndup with strlen()

strlen() can potentially return values < 6 for empty or really short strings.
If we now subtract the value of 6 without further checking, we end up
with a wrap of the unsigned size_t that effectively results in a very
very large value in size_t that will likely cause the memory allocation
in g_strndup() to fail.

Fix this by checking for path string actually having a *.raucb suffix and
only strip in this case.

Signed-off-by: Enrico Joerns <a2e5f936c390f36494e46e71bcfbe365bb1e8c49@pengutronix.de>

jluebbe/rauc,rauc/rauc,ejoerns/rauc,rauc/rauc,ejoerns/rauc,jluebbe/rauc,ejoerns/rauc,jluebbe/rauc,rauc/rauc