[Bufferoverrun] add vector test for cpp

Summary: add test for bufferoverrun

Reviewed By: jvillard

Differential Revision: D4928322

fbshipit-source-id: 2cd1e21
master
Kihong Heo 8 years ago committed by Facebook Github Bot
parent e77c1d8ea6
commit 9cad51d00a

@ -23,6 +23,7 @@ SOURCES = \
siof/siof_templated.cpp \ siof/siof_templated.cpp \
siof/siof_different_tu.cpp \ siof/siof_different_tu.cpp \
siof/std_ios_base_init.cpp \ siof/std_ios_base_init.cpp \
bufferoverrun/vector.cpp \
HEADERS = siof/siof_types.h HEADERS = siof/siof_types.h

@ -0,0 +1,14 @@
/*
* Copyright (c) 2017 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <vector>
void FN_out_of_bound_Bad(std::vector<int> v) {
unsigned int n = v.size();
v[n] = 1;
}
Loading…
Cancel
Save