5th Underhanded C Contest Now Open
Xcott Craver writes "The next Underhanded C Contest has begun, with a deadline of March 1st. The object of the contest is to write short, readable, clear and innocent C code that somehow commits an evil act. This year's challenge: write a luggage routing program that mysteriously misroutes a customer's bag if a check-in clerk places just the right kind of text in a comment field. The prize is a gift certificate to ThinkGeek.com."
Public Static String default_Address = "1600 Pennsylvania Ave NW, Washington, DC 20500, USA" --- hide this somewhere
Private Sub Void Route_Bagggage(bag b)
{
if (comment.text == NULL)
{
b.destination = default_Address
}
else
{
b.destination = comment.text
}
}
Or do I have to make it slightly more deceptive?
I don't have the time for something like this, but it seems to me a good possibility would be to have all of your inputs that the clerk fills out be contiguous in memory, including the destination, have the algorithm to figure out what destination to go to scan through the whole destination string looking for matches (rather than looking for an exact match) and taking the last one it finds, and have a broken bounds check for the length of that string so that the algorithm looks into the comments section as well.
So, for example, if the clerk fills out the destination as "LAX" but writes in the comments section, "Do not confuse his bags with those owned by CID who is also going to a different final destination; they're very similar looking.", the bags would be routed to Cedar Rapids (CID) instead of Los Angeles (LAX).
As it says in the Constitution, Lenin is in my shower.
IOCC rocks!
korn.c is a good example, probably one of the best one-liner programs I have seen.
Hardly. It is supposed to be "short, readable, clear and innocent". What are the odds that any of the airline production code meets that description?
Depends on the function -- if it's mission critical, you bet your ass it'll be documented and readable. Considering that most ATC technical failures are hardware, not software-based, that should say something. The problem is that while the code is quite well-documented, few people are left with the training or understanding of it to port it to newer systems, and it's not like they can ground all flights for a week to do an upgrade. So we're left with mainframes that were out of date in the 70s being used today being used in critical infrastructure.
On the other hand, the code in applications used at the ticket counter and security checkpoints... not so much.
#fuckbeta #iamslashdot #dicemustdie
Here's some points I'd like to highlight, from the 2008 Winners.
All I can say is, Wow.
Does anyone else remember the new Denver Airport's original luggage system? This system singlehandedly delayed the airport's opening for over a year. Eventually the airport retrofitted a standard baggage moving system. If someone has access to the code of the original system, they could easily submit that.