瀏覽代碼

Merge pull request #17257 from and3rson/master

Fix garbage in string padding.
Rémi Verschelde 7 年之前
父節點
當前提交
ced5b57a60
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/io/marshalls.cpp

+ 1 - 1
core/io/marshalls.cpp

@@ -813,7 +813,7 @@ static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) {
 	while (r_len % 4) {
 	while (r_len % 4) {
 		r_len++; //pad
 		r_len++; //pad
 		if (buf) {
 		if (buf) {
-			buf++;
+			*(buf++) = 0;
 		}
 		}
 	}
 	}
 }
 }