]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: guid: fix crash on invalid guid name
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 Apr 2024 09:05:02 +0000 (11:05 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 Apr 2024 13:09:53 +0000 (15:09 +0200)
commit32b9e97f9207c2d57dee1d6842f7b9ee52fb3c76
tree14597ede47242c2c609bbde8eaf08b9a55aebed7
parentd78c346670529556433fa09494dd546360f95b62
BUG/MINOR: guid: fix crash on invalid guid name

Using an invalid GUID for guid_insert() causes a crash. This is easily
reproducible using for example an invalid character with "guid" keyword.
Here is the provided backtrace :

  Thread 1 "haproxy" received signal SIGSEGV, Segmentation fault.
  0x00005555561fda95 in guid_insert (objt=0x520000002080, uid=0x519000002dac "@foo2", errmsg=0x7ffff4c0a7a0)
      at src/guid.c:83
  83              ha_free(&guid->node.key);

This error is present in guid_insert() cleanup parts. GUID node is not
allocated in case of an early error so it's impossible to dereference it
to free guid.node.key. Fix this simply by using an intermediary pointer
key.

This does not need to be backported.
src/guid.c