Skip to content

Commit

Permalink
Don't dereference vector if empty on RadioTapWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
mfontanini committed Jun 6, 2017
1 parent 2f52887 commit edd289c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/radiotap_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void RadioTapWriter::write_option(const RadioTap::option& option) {
}
parser.advance_field();
}
size_t offset = candidate_ptr - &*buffer_.begin();
size_t offset = is_empty ? 0 : candidate_ptr - &*buffer_.begin();
const RadioTapParser::FieldMetadata& meta = RadioTapParser::RADIOTAP_METADATA[bit];

vector<uint8_t> paddings = build_padding_vector(candidate_ptr, parser);
Expand Down

0 comments on commit edd289c

Please sign in to comment.