Explorar o código

Merge pull request #17257 from and3rson/master

Fix garbage in string padding.
Rémi Verschelde %!s(int64=7) %!d(string=hai) anos
pai
achega
ced5b57a60
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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) {
 		r_len++; //pad
 		if (buf) {
-			buf++;
+			*(buf++) = 0;
 		}
 	}
 }