This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int * data = (int *)malloc(100*sizeof(int)); | |
data[0] = 5; | |
printIntLine(data[0]); | |
data = (int *)realloc(data, (130000)*sizeof(int)); | |
if (data != NULL) | |
{ | |
data[0] = 10; | |
printIntLine(data[0]); | |
free(data); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char charBuffer[CHAR_BUFFER_SIZE]; | |
cin >> charBuffer; | |
charBuffer[CHAR_BUFFER_SIZE-1] = '\0'; | |
printLine(charBuffer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hidden_Error__fscanf_strncpy_84_bad::hidden_Error__fscanf_strncpy_84_bad(int dataCopy) | |
{ | |
data = dataCopy; | |
/* POTENTIAL FLAW: Read data from the console using fscanf() */ | |
fscanf(stdin, "%d", &data); | |
} | |
hidden_Error__fscanf_strncpy_84_bad::~hidden_Error__fscanf_strncpy_84_bad() | |
{ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static const struct { | |
DWORD winerr; | |
int doserr; | |
} doserrors[] = | |
{ | |
... | |
}; | |
static void | |
la_dosmaperr(unsigned long e) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STDMETHODIMP | |
CCustomAutoComplete::Next(..., ULONG *pceltFetched) | |
{ | |
... | |
if (pceltFetched != NULL) | |
*pceltFetched++; | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CONT_MAP_MAX 50 | |
int _iContMap[CONT_MAP_MAX]; | |
... | |
DockingManager::DockingManager() | |
{ | |
... | |
memset(_iContMap, -1, CONT_MAP_MAX); | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(IsLunaMenuStyle()) | |
if(!xp_space_accelerators) return; | |
else | |
if(!original_space_accelerators) return; | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
n_errs=`flawfinder -DQ *.c *.cpp | wc -l` | |
if [ "$n_errs" = "0" ]; then | |
exit 0 | |
else | |
echo "Houston we have a problem" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
n_errs=`flawfinder -DQ $1 | wc -l` | |
if [ "$n_errs" = "0" ]; then | |
echo "No prob bob" | |
else | |
echo "Houston we have a problem" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdio.h" | |
#include "string.h" | |
int main(int argc, char **argv) | |
{ | |
char text[1024]; | |
static int some_value = -72; | |
strcpy(text, argv[1]); /* ignore the buffer overflow here */ |