]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Ignore bridge template names with multiple printf conversions
authorJán Tomko <jtomko@redhat.com>
Tue, 28 Apr 2015 15:07:20 +0000 (17:07 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 11 May 2015 12:14:33 +0000 (14:14 +0200)
commit076dd379958ff55ef7e39d7f6a7a1c9efded2a77
treee58f95fead0a14d472a6b30227f812d914de73a2
parent2f37362e44400d91f51c9e147f71e98a4eca42c0
Ignore bridge template names with multiple printf conversions

For some reason, we allow a bridge name with %d in it, which we replace
with an unsigned integer to form a bridge name that does not yet exist
on the host.

Do not blindly pass it to virAsprintf if it's not the only conversion,
to prevent crashing on input like:

<network>
  <name>test</name>
  <forward mode='none'/>
  <bridge name='virbr%d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s'/>
</network>

Ignore any template strings that do not have exactly one %d conversion,
like we do in various drivers before calling virNetDevTapCreateInBridgePort.
src/network/bridge_driver.c