A software bug is an error, flaw, failure, or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.
So it is an error in the code that causes the software to behave in unexpected and unintended fashion, correct ?