Skip to content

Instantly share code, notes, and snippets.

@anon767
Last active May 17, 2023 14:31
Show Gist options
  • Save anon767/eef3454c4b9a6cbe8fe4e70d12276f64 to your computer and use it in GitHub Desktop.
Save anon767/eef3454c4b9a6cbe8fe4e70d12276f64 to your computer and use it in GitHub Desktop.
sample

Task

  1. sample.c contains a vulnerability. Why is this a vulnerability and which line is causing the flaw?
  2. Check out https://github.com/awsm-research/LineVul/tree/main/linevul LineVul is a vulnerability discovery model which uses a BERT-like transformer model and attention scores to calculate relevance scores. The relevance scores denote how likely it is for each line to contribute to a vulnerability. Can you tell which 3 lines of sample.c score top given the prediction of LineVul?
#include <iostream>
using namespace std;
#define MAXSIZE 40
void test(void)
{
char buf[MAXSIZE];
cin>>buf;
cout<<buf<<endl;
}
int main(int argc, char **argv)
{
test();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment