What is the maximum size of a transaction? I see from the source code (script.cpp) that there is an upper limit in the script size. It there any other limit to avoid a single transaction preventing other transactions of smaller sizes to get into a block?

How is this kind of attack prevented?

I've read in CTransaction::AcceptToMemoryPool the line:

if .... ::GetSerializeSize(*this, SER_NETWORK) &lt; 100) 
    return error("..."); 


Does this line means that the maximum transaction size is 100 bytes?
The maximum transaction size is the size of the block. Source.

// Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)
if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR &gt; MAX_BLOCK_WEIGHT)
    return state.DoS(100, false, REJECT_INVALID, "bad-txns-oversize");


Transactions larger than 100 kilobytes (including witness at a 75% discount rate) are non-standard. Source 1. Source 2.

static const unsigned int MAX_STANDARD_TX_WEIGHT = 400000;
...
if (sz &gt;= MAX_STANDARD_TX_WEIGHT)
{
    LogPrint(BCLog::MEMPOOL, "ignoring large orphan tx (size: %u, hash: %s)\n", sz, hash.ToString());
    return false;
}