Fixing improper use of memcpy in libcdg