Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 820b3e29 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Make transactGetSockaddr locale safe"

parents 25082e33 636c0ff4
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import java.net.InetAddress;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetSocketAddress;
import java.util.Locale;
import static libcore.io.OsConstants.*;

class CommonTimeUtils {
@@ -192,7 +193,8 @@ class CommonTimeUtils {
                if (AF_INET == type) {
                    int addr = reply.readInt();
                    port = reply.readInt();
                    addrStr = String.format("%d.%d.%d.%d", (addr >> 24) & 0xFF,
                    addrStr = String.format(Locale.US, "%d.%d.%d.%d",
                                                       (addr >> 24) & 0xFF,
                                                       (addr >> 16) & 0xFF,
                                                       (addr >>  8) & 0xFF,
                                                        addr        & 0xFF);
@@ -207,7 +209,7 @@ class CommonTimeUtils {
                    int flowinfo = reply.readInt();
                    int scope_id = reply.readInt();

                    addrStr = String.format("[%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X]",
                    addrStr = String.format(Locale.US, "[%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X]",
                                                       (addr1 >> 16) & 0xFFFF, addr1 & 0xFFFF,
                                                       (addr2 >> 16) & 0xFFFF, addr2 & 0xFFFF,
                                                       (addr3 >> 16) & 0xFFFF, addr3 & 0xFFFF,