If possible, use a USB cable without data function for charging. Tampered cables or USB sockets in hotels, buses or trains could read data or install unwanted software. If you are not sure, you can simply switch off your phone for the charging process. This way, nothing can be installed or read out and it will still charge.