Merge "Fix heap-buffer-overflow" into pi-dev