Here is the official sample of solidity:
if (highestBidder != 0) {
// Sending back the money by simply using
// highestBidder.send(highestBid) is a security risk
// because it can be prevented by the caller by e.g.
// raising the call stack to 1023. It is always safer
// to let the recipient withdraw their money themselves.
pendingReturns[highestBidder] += highestBid;
}
Question 1: What is the meaning of
because it can be prevented by the caller by e.g. raising the call stack to 1023*
if (now <= auctionStart + biddingTime)
throw; // auction did not yet end
if (ended)
throw; // this function has already been called
// 2. Effects
ended = true;
AuctionEnded(highestBidder, highestBid);
// 3. Interaction
if (!beneficiary.send(highestBid))
throw;
Question 2: If beneficiary.send(highestBid) failed, ended has been modified to true, and beneficiary.send(highestBid) will never be executed again. Is that a bug?