[lxc-devel] [lxc/lxc] a1c9a9: lxc/utils: bugfix freed pointer return value

GitHub noreply at github.com
Thu Nov 20 23:37:52 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: a1c9a9c97840b1b6b4e7a1ea9cf75aeb2f815659
      https://github.com/lxc/lxc/commit/a1c9a9c97840b1b6b4e7a1ea9cf75aeb2f815659
  Author: Silvio Fricke <silvio.fricke at gmail.com>
  Date:   2014-11-19 (Wed, 19 Nov 2014)

  Changed paths:
    M src/lxc/utils.c

  Log Message:
  -----------
  lxc/utils: bugfix freed pointer return value

We allocate a pointer and save this address in a static variable. After
this we freed this pointer and return.

Here a cuttout of a valgrind report:

	[...]
	==11568== Invalid read of size 1
	==11568==    at 0x4C2D524: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
	==11568==    by 0x5961C9B: puts (in /usr/lib/libc-2.20.so)
	==11568==    by 0x400890: main (lxc_config.c:73)
	==11568==  Address 0x6933e21 is 1 bytes inside a block of size 32 free'd
	==11568==    at 0x4C2B200: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
	==11568==    by 0x4E654F2: lxc_global_config_value (utils.c:415)
	==11568==    by 0x4E92177: lxc_get_global_config_item (lxccontainer.c:2287)
	==11568==    by 0x400883: main (lxc_config.c:71)
	[...]

Signed-off-by: Silvio Fricke <silvio.fricke at gmail.com>


  Commit: 80cf8077b3f5a019a8e4dcc481076d5b2a6b9edb
      https://github.com/lxc/lxc/commit/80cf8077b3f5a019a8e4dcc481076d5b2a6b9edb
  Author: hallyn <serge at hallyn.com>
  Date:   2014-11-20 (Thu, 20 Nov 2014)

  Changed paths:
    M src/lxc/utils.c

  Log Message:
  -----------
  Merge pull request #358 from silvio/sfr/bugfix-freed-return-value

lxc/utils: bugfix freed pointer return value


Compare: https://github.com/lxc/lxc/compare/40580b462409...80cf8077b3f5


More information about the lxc-devel mailing list