bytecode, not source code.
Redistribution of copyright protected material requires authorization of the right holder. Code (or programs compiled from code), usually fall under this rule.
(In the US) hoster privilege usually allows them to not be liable unless they know about a specific infraction. In some jurisdictions some platforms (such as youtube) are required to monitor uploads proactively for known copyright violations.