Skip to content

Instantly share code, notes, and snippets.

View bshastry's full-sized avatar

Bhargava Shastry bshastry

View GitHub Profile
@bshastry
bshastry / extract-breakpoints.sh
Created October 14, 2015 14:45
Create gdb style breakpoints from Clang SA bug reports
#!/usr/bin/env bash
DIR=$1
for file in $(find $DIR/report*.html);
do
filename=$(sed '63q;d' $file | awk '{print $3}');
linenum=$(sed '69q;d' $file | awk '{print $3}');
echo -e "break $filename:$linenum";
done
Abhradeep Thakurta
Adam Bates
Ahmad-Reza Sadeghi
Alex Biryukov
Alex Halderman
Alex Snoeren
Alina Oprea
Amin Vahdat
Amir Herzberg
Amir Houmansadr
Aaron Johnson
Adam Bates
Adam Doupé
Adrian Perrig
Aggelos Kiayias
Alex Biryukov
Alina Oprea
Alvaro A. Cardenas
Amir Houmansadr
Andrea Lanzi

Keybase proof

I hereby claim:

  • I am bshastry on github.
  • I am bshastry (https://keybase.io/bshastry) on keybase.
  • I have a public key whose fingerprint is 0C8D 6170 F162 7AEB 358F 6571 03EF 3FA5 CD1D 7232

To claim this, I am signing this object:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#define BUF_SIZE 1024
#define TEST_STR "test"
void parse(char *buf) {
if (strcmp(buf, TEST_STR))
@bshastry
bshastry / libpng_read_fuzzer.cc
Created September 21, 2018 09:40
snippet of libpng oss-fuzz test harness
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (size < kPngHeaderSize) {
return 0;
}
std::vector<unsigned char> v(data, data + size);
if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) {
// not a PNG.
return 0;
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
import pandas
from scipy.stats import mannwhitneyu
from scipy import stats
from a12 import *
try:
# for Python2
@bshastry
bshastry / solc_json_io.json
Created October 20, 2018 16:02
Solc JSON I/O example
{
"language": "Solidity",
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"": [
@bshastry
bshastry / solc_json_out.json
Created October 20, 2018 16:07
solc json io
{
"contracts": {
"": {
"test": {
"abi": [
{
"constant": false,
"inputs": [
{
"name": "",
@bshastry
bshastry / buggy.cpp
Created November 3, 2018 15:50
Solidity failing assertion
bool StructType::canBeUsedExternally(bool _inLibrary) const
{
if (_inLibrary && location() == DataLocation::Storage)
return true;
else if (recursive())
return false;
else
{
// Check that all members have interface types.
// We pass "false" to canBeUsedExternally (_inLibrary), because this struct will be