Unnamed: 0
int64
0
56k
source_code
stringlengths
55
5.98k
comments
stringlengths
2
1.76k
label
stringclasses
68 values
dataset_name
stringclasses
1 value
file_name
stringlengths
208
265
function
stringlengths
27
87
decompiled_code
stringlengths
68
3.97k
compiler_options
stringclasses
1 value
10,000
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112731/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31_good(void) { goodB2G(); return; }
['gcc']
10,001
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32_bad() { char * data; char * *dataPtr1 = &data; char * *dataPtr2 = &data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { char * data = *dataPtr1; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); *dataPtr1 = data; } { char * data = *dataPtr2; /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112732/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32_bad(void) { char *pcStack_30; undefined8 *puStack_28; char **ppcStack_20; char **ppcStack_18; char *pcStack_10; ppcStack_18 = &pcStack_30; ppcStack_20 = &pcStack_30; pcStack_30 = (char *)func_0x00400ab0(100); *pcStack_30 = '\0'; puStack_28 = (undefined8 *)*ppcStack_18; *puStack_28 = 0x7453206465786946; *(undefined4 *)(puStack_28 + 1) = 0x676e6972; *(undefined *)((long)puStack_28 + 0xc) = 0; *ppcStack_18 = (char *)puStack_28; pcStack_10 = *ppcStack_20; do { if (*pcStack_10 == '\0') { code_r0x00400c65: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011f4); goto code_r0x00400c65; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,002
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112732/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_32_good(void) { goodB2G(); return; }
['gcc']
10,003
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34_bad() { char * data; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34_unionType myUnion; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); myUnion.unionFirst = data; { char * data = myUnion.unionSecond; /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112734/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34_bad(void) { undefined8 *puStack_10; puStack_10 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puStack_10 = 0; *puStack_10 = 0x7453206465786946; *(undefined4 *)(puStack_10 + 1) = 0x676e6972; *(undefined *)((long)puStack_10 + 0xc) = 0; do { if (*(char *)puStack_10 == '\0') { code_r0x00400c44: func_0x00400a20(puStack_10); return; } if (*(char *)puStack_10 == 'S') { printLine(&UNK_004011d4); goto code_r0x00400c44; } puStack_10 = (undefined8 *)((long)puStack_10 + 1); } while( true ); }
['gcc']
10,004
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112734/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_34_good(void) { goodB2G(); return; }
['gcc']
10,005
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); badSink(data); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112735/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41_bad(void) { undefined8 *puVar1; puVar1 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puVar1 = 0; *puVar1 = 0x7453206465786946; *(undefined4 *)(puVar1 + 1) = 0x676e6972; *(undefined *)((long)puVar1 + 0xc) = 0; badSink(puVar1); return; }
['gcc']
10,006
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112735/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_41_good(void) { goodB2G(); return; }
['gcc']
10,007
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; data = badSource(data); /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112736/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42_bad(void) { undefined *puVar1; char *pcStack_10; puVar1 = (undefined *)func_0x00400ab0(100); *puVar1 = 0; pcStack_10 = (char *)badSource(puVar1); do { if (*pcStack_10 == '\0') { code_r0x00400c52: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011e4); goto code_r0x00400c52; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,008
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112736/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_42_good(void) { goodB2G(); return; }
['gcc']
10,009
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_badSink(data); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112740/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51_bad(void) { undefined8 *puVar1; puVar1 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puVar1 = 0; *puVar1 = 0x7453206465786946; *(undefined4 *)(puVar1 + 1) = 0x676e6972; *(undefined *)((long)puVar1 + 0xc) = 0; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_badSink(puVar1); return; }
['gcc']
10,010
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112740/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51_good(void) { goodB2G(); return; }
['gcc']
10,011
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_badSink(char * data) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112740/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_badSink(char *param_1) { char *pcStack_10; pcStack_10 = param_1; do { if (*pcStack_10 == '\0') { code_r0x00400c07: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011e4); goto code_r0x00400c07; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,012
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_goodB2GSink(char * data) { { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112740/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_51b_goodB2GSink(long param_1) { ulong uVar1; ulong uStack_10; uStack_10 = 0; do { uVar1 = func_0x00400a90(param_1); if (uVar1 <= uStack_10) { code_r0x00400c6d: func_0x00400a60(param_1); return; } if (*(char *)(uStack_10 + param_1) == 'S') { printLine(&UNK_00401254); goto code_r0x00400c6d; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,013
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_badSink(data); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112741/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52_bad(void) { undefined8 *puVar1; puVar1 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puVar1 = 0; *puVar1 = 0x7453206465786946; *(undefined4 *)(puVar1 + 1) = 0x676e6972; *(undefined *)((long)puVar1 + 0xc) = 0; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_badSink(puVar1); return; }
['gcc']
10,014
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112741/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52_good(void) { goodB2G(); return; }
['gcc']
10,015
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_badSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_badSink(data); }
[]
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112741/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_badSink(undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_badSink(param_1); return; }
['gcc']
10,016
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_goodB2GSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112741/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52b_goodB2GSink (undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_goodB2GSink(param_1); return; }
['gcc']
10,017
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_badSink(char * data) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112741/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_badSink(char *param_1) { char *pcStack_10; pcStack_10 = param_1; do { if (*pcStack_10 == '\0') { code_r0x00400c07: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011f4); goto code_r0x00400c07; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,018
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_goodB2GSink(char * data) { { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112741/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_52c_goodB2GSink(long param_1) { ulong uVar1; ulong uStack_10; uStack_10 = 0; do { uVar1 = func_0x00400a90(param_1); if (uVar1 <= uStack_10) { code_r0x00400c6d: func_0x00400a60(param_1); return; } if (*(char *)(uStack_10 + param_1) == 'S') { printLine(&UNK_00401274); goto code_r0x00400c6d; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,019
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_badSink(data); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53_bad(void) { undefined8 *puVar1; puVar1 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puVar1 = 0; *puVar1 = 0x7453206465786946; *(undefined4 *)(puVar1 + 1) = 0x676e6972; *(undefined *)((long)puVar1 + 0xc) = 0; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_badSink(puVar1); return; }
['gcc']
10,020
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53_good(void) { goodB2G(); return; }
['gcc']
10,021
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_badSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_badSink(data); }
[]
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_badSink(undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_badSink(param_1); return; }
['gcc']
10,022
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_goodB2GSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53b_goodB2GSink (undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_goodB2GSink(param_1); return; }
['gcc']
10,023
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_badSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_badSink(data); }
[]
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_badSink(undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_badSink(param_1); return; }
['gcc']
10,024
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_goodB2GSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53c_goodB2GSink (undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_goodB2GSink(param_1); return; }
['gcc']
10,025
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_badSink(char * data) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_badSink(char *param_1) { char *pcStack_10; pcStack_10 = param_1; do { if (*pcStack_10 == '\0') { code_r0x00400c07: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401214); goto code_r0x00400c07; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,026
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_goodB2GSink(char * data) { { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112742/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_53d_goodB2GSink(long param_1) { ulong uVar1; ulong uStack_10; uStack_10 = 0; do { uVar1 = func_0x00400a90(param_1); if (uVar1 <= uStack_10) { code_r0x00400c6d: func_0x00400a60(param_1); return; } if (*(char *)(uStack_10 + param_1) == 'S') { printLine(&UNK_00401284); goto code_r0x00400c6d; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,027
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_badSink(data); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54_bad(void) { undefined8 *puVar1; puVar1 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puVar1 = 0; *puVar1 = 0x7453206465786946; *(undefined4 *)(puVar1 + 1) = 0x676e6972; *(undefined *)((long)puVar1 + 0xc) = 0; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_badSink(puVar1); return; }
['gcc']
10,028
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54_good(void) { goodB2G(); return; }
['gcc']
10,029
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_badSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_badSink(data); }
[]
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_badSink(undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_badSink(param_1); return; }
['gcc']
10,030
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_goodB2GSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54b_goodB2GSink (undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_goodB2GSink(param_1); return; }
['gcc']
10,031
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_badSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_badSink(data); }
[]
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_badSink(undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_badSink(param_1); return; }
['gcc']
10,032
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_goodB2GSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54c_goodB2GSink (undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_goodB2GSink(param_1); return; }
['gcc']
10,033
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_badSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_badSink(data); }
[]
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_badSink(undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_badSink(param_1); return; }
['gcc']
10,034
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_goodB2GSink(char * data) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54d_goodB2GSink (undefined8 param_1) { CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_goodB2GSink(param_1); return; }
['gcc']
10,035
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_badSink(char * data) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_badSink(char *param_1) { char *pcStack_10; pcStack_10 = param_1; do { if (*pcStack_10 == '\0') { code_r0x00400c07: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401234); goto code_r0x00400c07; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,036
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_goodB2GSink(char * data) { { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112743/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_54e_goodB2GSink(long param_1) { ulong uVar1; ulong uStack_10; uStack_10 = 0; do { uVar1 = func_0x00400a90(param_1); if (uVar1 <= uStack_10) { code_r0x00400c6d: func_0x00400a60(param_1); return; } if (*(char *)(uStack_10 + param_1) == 'S') { printLine(&UNK_004012a4); goto code_r0x00400c6d; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,037
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_badSource(data); /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112744/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61_bad(void) { undefined *puVar1; char *pcStack_10; puVar1 = (undefined *)func_0x00400ab0(100); *puVar1 = 0; pcStack_10 = (char *)CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_badSource (puVar1); do { if (*pcStack_10 == '\0') { code_r0x00400c28: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011e4); goto code_r0x00400c28; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,038
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112744/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61_good(void) { goodB2G(); return; }
['gcc']
10,039
char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_badSource(char * data) { /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); return data; }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112744/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_badSource
undefined8 * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_badSource(undefined8 *param_1) { *param_1 = 0x7453206465786946; *(undefined4 *)(param_1 + 1) = 0x676e6972; *(undefined *)((long)param_1 + 0xc) = 0; return param_1; }
['gcc']
10,040
char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_goodB2GSource(char * data) { /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); return data; }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112744/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_goodB2GSource
undefined8 * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_61b_goodB2GSource(undefined8 *param_1) { *param_1 = 0x7453206465786946; *(undefined4 *)(param_1 + 1) = 0x676e6972; *(undefined *)((long)param_1 + 0xc) = 0; return param_1; }
['gcc']
10,041
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_badSink(&data); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112746/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63_bad(void) { undefined8 *puStack_10; puStack_10 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puStack_10 = 0; *puStack_10 = 0x7453206465786946; *(undefined4 *)(puStack_10 + 1) = 0x676e6972; *(undefined *)((long)puStack_10 + 0xc) = 0; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_badSink(&puStack_10); return; }
['gcc']
10,042
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112746/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63_good(void) { goodB2G(); return; }
['gcc']
10,043
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_badSink(char * * dataPtr) { char * data = *dataPtr; /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112746/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_badSink(char **param_1) { char *pcStack_10; pcStack_10 = *param_1; do { if (*pcStack_10 == '\0') { code_r0x00400c12: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011e4); goto code_r0x00400c12; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,044
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_goodB2GSink(char * * dataPtr) { char * data = *dataPtr; { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112746/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_63b_goodB2GSink(long *param_1) { long lVar1; ulong uVar2; ulong uStack_10; lVar1 = *param_1; uStack_10 = 0; do { uVar2 = func_0x00400a90(lVar1); if (uVar2 <= uStack_10) { code_r0x00400c78: func_0x00400a60(lVar1); return; } if (*(char *)(uStack_10 + lVar1) == 'S') { printLine(&UNK_00401264); goto code_r0x00400c78; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,045
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_badSink(&data); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112747/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64_bad(void) { undefined8 *puStack_10; puStack_10 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puStack_10 = 0; *puStack_10 = 0x7453206465786946; *(undefined4 *)(puStack_10 + 1) = 0x676e6972; *(undefined *)((long)puStack_10 + 0xc) = 0; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_badSink(&puStack_10); return; }
['gcc']
10,046
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112747/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64_good(void) { goodB2G(); return; }
['gcc']
10,047
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ char * * dataPtr = (char * *)dataVoidPtr; /* dereference dataPtr into data */ char * data = (*dataPtr); /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112747/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_badSink(char **param_1) { char *pcStack_10; pcStack_10 = *param_1; do { if (*pcStack_10 == '\0') { code_r0x00400c1a: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011f4); goto code_r0x00400c1a; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,048
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_goodB2GSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ char * * dataPtr = (char * *)dataVoidPtr; /* dereference dataPtr into data */ char * data = (*dataPtr); { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112747/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_64b_goodB2GSink(long *param_1) { long lVar1; ulong uVar2; ulong uStack_10; lVar1 = *param_1; uStack_10 = 0; do { uVar2 = func_0x00400a90(lVar1); if (uVar2 <= uStack_10) { code_r0x00400c80: func_0x00400a60(lVar1); return; } if (*(char *)(uStack_10 + lVar1) == 'S') { printLine(&UNK_00401264); goto code_r0x00400c80; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,049
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66_bad() { char * data; char * dataArray[5]; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); /* put data in array */ dataArray[2] = data; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_badSink(dataArray); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* put data in array */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112749/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66_bad(void) { undefined auStack_38 [16]; undefined8 *puStack_28; undefined8 *puStack_10; puStack_28 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puStack_28 = 0; *puStack_28 = 0x7453206465786946; *(undefined4 *)(puStack_28 + 1) = 0x676e6972; *(undefined *)((long)puStack_28 + 0xc) = 0; puStack_10 = puStack_28; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_badSink(auStack_38); return; }
['gcc']
10,050
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112749/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66_good(void) { goodB2G(); return; }
['gcc']
10,051
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_badSink(char * dataArray[]) { /* copy data out of dataArray */ char * data = dataArray[2]; /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* copy data out of dataArray */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112749/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_badSink(long param_1) { char *pcStack_10; pcStack_10 = *(char **)(param_1 + 0x10); do { if (*pcStack_10 == '\0') { code_r0x00400c13: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011f4); goto code_r0x00400c13; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,052
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_goodB2GSink(char * dataArray[]) { char * data = dataArray[2]; { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112749/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_66b_goodB2GSink(long param_1) { long lVar1; ulong uVar2; ulong uStack_10; lVar1 = *(long *)(param_1 + 0x10); uStack_10 = 0; do { uVar2 = func_0x00400a90(lVar1); if (uVar2 <= uStack_10) { code_r0x00400c79: func_0x00400a60(lVar1); return; } if (*(char *)(uStack_10 + lVar1) == 'S') { printLine(&UNK_00401264); goto code_r0x00400c79; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,053
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_bad() { char * data; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_structType myStruct; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; /* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */ strcpy(data, BAD_SOURCE_FIXED_STRING); myStruct.structFirst = data; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_badSink(myStruct); }
['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112750/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_bad(void) { undefined8 *puVar1; puVar1 = (undefined8 *)func_0x00400ab0(100); *(undefined *)puVar1 = 0; *puVar1 = 0x7453206465786946; *(undefined4 *)(puVar1 + 1) = 0x676e6972; *(undefined *)((long)puVar1 + 0xc) = 0; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_badSink(puVar1); return; }
['gcc']
10,054
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112750/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_good(void) { goodB2G(); return; }
['gcc']
10,055
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_badSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_structType myStruct) { char * data = myStruct.structFirst; /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112750/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_badSink(char *param_1) { char *pcStack_10; pcStack_10 = param_1; do { if (*pcStack_10 == '\0') { code_r0x00400c0f: func_0x00400a20(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_004011f4); goto code_r0x00400c0f; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,056
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_goodB2GSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67_structType myStruct) { char * data = myStruct.structFirst; { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112750/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_goodB2GSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_67b_goodB2GSink(long param_1) { ulong uVar1; ulong uStack_10; uStack_10 = 0; do { uVar1 = func_0x00400a90(param_1); if (uVar1 <= uStack_10) { code_r0x00400c75: func_0x00400a60(param_1); return; } if (*(char *)(uStack_10 + param_1) == 'S') { printLine(&UNK_00401264); goto code_r0x00400c75; } uStack_10 = uStack_10 + 1; } while( true ); }
['gcc']
10,057
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112759/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010cf: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401664); goto code_r0x004010cf; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,058
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112759/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_01_good(void) { goodB2G(); return; }
['gcc']
10,059
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(1) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112760/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010cf: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401664); goto code_r0x004010cf; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,060
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112760/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_02_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,061
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(5==5) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112761/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010cf: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401664); goto code_r0x004010cf; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,062
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112761/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_03_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,063
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(STATIC_CONST_TRUE) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112762/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010d8: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_0040166c); goto code_r0x004010d8; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,064
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112762/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,065
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(staticTrue) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112763/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } if (staticTrue != 0) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401664); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,066
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112763/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_05_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,067
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(STATIC_CONST_FIVE==5) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112764/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010d9: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401668); goto code_r0x004010d9; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,068
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112764/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_06_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,069
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(staticFive==5) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112765/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } if (staticFive == 5) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401664); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,070
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112765/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,071
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(staticReturnsTrue()) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112766/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } iVar1 = staticReturnsTrue(); if (iVar1 != 0) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401684); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,072
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112766/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,073
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(GLOBAL_CONST_TRUE) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112767/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } if (GLOBAL_CONST_TRUE != 0) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401664); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,074
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112767/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_09_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,075
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(globalTrue) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112768/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } if (globalTrue != 0) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401664); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,076
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112768/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_10_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,077
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(globalReturnsTrue()) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112769/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } iVar1 = globalReturnsTrue(); if (iVar1 != 0) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401664); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,078
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112769/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_11_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,079
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(globalReturnsTrueOrFalse()) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } else { { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112770/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12_bad(void) { int iVar1; ulong uVar2; undefined2 uStack_58; undefined2 uStack_56; undefined4 uStack_54; undefined *puStack_40; int iStack_34; long lStack_30; int iStack_24; ulong uStack_20; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_24 = 0xffffffff; iStack_14 = -1; lStack_30 = func_0x00400cf0(pcStack_10); iStack_24 = func_0x00400e20(2,1,6); if (iStack_24 != -1) { func_0x00400d30(&uStack_58,0,0x10); uStack_58 = 2; uStack_54 = 0; uStack_56 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_24,&uStack_58,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_24,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_24,0,0), iStack_14 != -1)) && ((iStack_34 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_30,99 - lStack_30,0), iStack_34 != -1 && (iStack_34 != 0)))) { pcStack_10[iStack_34 + lStack_30] = '\0'; puStack_40 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_40 != (undefined *)0x0) { *puStack_40 = 0; } puStack_40 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_40 != (undefined *)0x0) { *puStack_40 = 0; } } } if (iStack_24 != -1) { func_0x00400d40(iStack_24); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { uStack_20 = 0; while (uVar2 = func_0x00400cf0(pcStack_10), uStack_20 < uVar2) { if (pcStack_10[uStack_20] == 'S') { printLine(&UNK_004016b4); break; } uStack_20 = uStack_20 + 1; } func_0x00400cb0(pcStack_10); } else { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_004016b4); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,080
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112770/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_12_good(void) { goodB2G(); return; }
['gcc']
10,081
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(GLOBAL_CONST_FIVE==5) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112771/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } if (GLOBAL_CONST_FIVE == 5) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401664); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,082
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112771/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_13_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,083
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } if(globalFive==5) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112772/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } if (globalFive == 5) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401664); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,084
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112772/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_14_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,085
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } switch(6) { case 6: /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112773/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010cf: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401664); goto code_r0x004010cf; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,086
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112773/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_15_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,087
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } while(1) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); break; } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112774/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010cf: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401664); goto code_r0x004010cf; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,088
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112774/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_16_good(void) { goodB2G(); return; }
['gcc']
10,089
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17_bad() { int j; char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } for(j = 0; j < 1; j++) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112775/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_20; int iStack_1c; char *pcStack_18; int iStack_c; pcStack_18 = (char *)func_0x00400da0(100); *pcStack_18 = '\0'; iStack_20 = 0xffffffff; iStack_1c = -1; lStack_28 = func_0x00400cf0(pcStack_18); iStack_20 = func_0x00400e20(2,1,6); if (iStack_20 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_20,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_20,5), iVar1 != -1)) && (iStack_1c = func_0x00400df0(iStack_20,0,0), iStack_1c != -1)) && ((iStack_2c = func_0x00400cc0(iStack_1c,pcStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1 && (iStack_2c != 0)))) { pcStack_18[iStack_2c + lStack_28] = '\0'; puStack_38 = (undefined *)func_0x00400d10(pcStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400d10(pcStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_20 != -1) { func_0x00400d40(iStack_20); } if (iStack_1c != -1) { func_0x00400d40(iStack_1c); } iStack_c = 0; do { if (0 < iStack_c) { return; } for (; *pcStack_18 != '\0'; pcStack_18 = pcStack_18 + 1) { if (*pcStack_18 == 'S') { printLine(&UNK_00401674); break; } } func_0x00400cb0(pcStack_18); iStack_c = iStack_c + 1; } while( true ); }
['gcc']
10,090
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112775/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17_good(void) { goodB2G(); return; }
['gcc']
10,091
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } goto sink; sink: /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112776/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_18; int iStack_14; char *pcStack_10; pcStack_10 = (char *)func_0x00400da0(100); *pcStack_10 = '\0'; iStack_18 = 0xffffffff; iStack_14 = -1; lStack_20 = func_0x00400cf0(pcStack_10); iStack_18 = func_0x00400e20(2,1,6); if (iStack_18 != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_18,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400df0(iStack_18,0,0), iStack_14 != -1)) && ((iStack_24 = func_0x00400cc0(iStack_14,pcStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1 && (iStack_24 != 0)))) { pcStack_10[iStack_24 + lStack_20] = '\0'; puStack_30 = (undefined *)func_0x00400d10(pcStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400d10(pcStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_18 != -1) { func_0x00400d40(iStack_18); } if (iStack_14 != -1) { func_0x00400d40(iStack_14); } do { if (*pcStack_10 == '\0') { code_r0x004010d0: func_0x00400cb0(pcStack_10); return; } if (*pcStack_10 == 'S') { printLine(&UNK_00401664); goto code_r0x004010d0; } pcStack_10 = pcStack_10 + 1; } while( true ); }
['gcc']
10,092
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18_good() { goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112776/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_18_good(void) { goodB2G(); return; }
['gcc']
10,093
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } badStatic = 1; /* true */ badSink(data); }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* true */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112777/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined *puStack_18; int iStack_c; puStack_18 = (undefined *)func_0x00400da0(100); *puStack_18 = 0; iStack_1c = 0xffffffff; iStack_c = -1; lStack_28 = func_0x00400cf0(puStack_18); iStack_1c = func_0x00400e20(2,1,6); if (iStack_1c != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_1c,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_1c,5), iVar1 != -1)) && (iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) && ((iStack_2c = func_0x00400cc0(iStack_c,puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1 && (iStack_2c != 0)))) { puStack_18[iStack_2c + lStack_28] = 0; puStack_38 = (undefined *)func_0x00400d10(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400d10(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400d40(iStack_1c); } if (iStack_c != -1) { func_0x00400d40(iStack_c); } badStatic = 1; badSink(puStack_18); return; }
['gcc']
10,094
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112777/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_21_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,095
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_bad() { char * data; data = (char *)malloc(100*sizeof(char)); data[0] = '\0'; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badGlobal = 1; /* true */ CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badSink(data); }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* true */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112778/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_bad
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_bad(void) { int iVar1; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined *puStack_18; int iStack_c; puStack_18 = (undefined *)func_0x00400da0(100); *puStack_18 = 0; iStack_1c = 0xffffffff; iStack_c = -1; lStack_28 = func_0x00400cf0(puStack_18); iStack_1c = func_0x00400e20(2,1,6); if (iStack_1c != -1) { func_0x00400d30(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400d00(0x6987); iVar1 = func_0x00400de0(iStack_1c,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400dd0(iStack_1c,5), iVar1 != -1)) && (iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) && ((iStack_2c = func_0x00400cc0(iStack_c,puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1 && (iStack_2c != 0)))) { puStack_18[iStack_2c + lStack_28] = 0; puStack_38 = (undefined *)func_0x00400d10(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400d10(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400d40(iStack_1c); } if (iStack_c != -1) { func_0x00400d40(iStack_c); } CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badGlobal = 1; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badSink(puStack_18); return; }
['gcc']
10,096
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_good() { goodB2G1(); goodB2G2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112778/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22a.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_good
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_good(void) { goodB2G1(); goodB2G2(); return; }
['gcc']
10,097
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badSink(char * data) { if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badGlobal) { /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the * memory block not at the start of the buffer */ for (; *data != '\0'; data++) { if (*data == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } }
['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */']
['CWE761']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112778/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badSink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badSink(char *param_1) { char *pcStack_10; pcStack_10 = param_1; if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_badGlobal != 0) { for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) { if (*pcStack_10 == 'S') { printLine(&UNK_00401684); break; } } func_0x00400cb0(pcStack_10); } return; }
['gcc']
10,098
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G1Sink(char * data) { if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } } }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112778/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G1Sink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G1Sink(long param_1) { ulong uVar1; ulong uStack_10; if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G1Global == 0) { uStack_10 = 0; while( true ) { uVar1 = func_0x00400cf0(param_1); if (uVar1 <= uStack_10) break; if (*(char *)(uStack_10 + param_1) == 'S') { printLine(&UNK_004018f9); break; } uStack_10 = uStack_10 + 1; } func_0x00400cb0(param_1); } else { printLine(&UNK_004018e4); } return; }
['gcc']
10,099
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G2Sink(char * data) { if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G2Global) { { size_t i; /* FIX: Use a loop variable to traverse through the string pointed to by data */ for (i=0; i < strlen(data); i++) { if (data[i] == SEARCH_CHAR) { printLine("We have a match!"); break; } } free(data); } } }
['/* FIX: Use a loop variable to traverse through the string pointed to by data */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112778/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22b.c
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G2Sink
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G2Sink(long param_1) { ulong uVar1; ulong uStack_10; if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_22_goodB2G2Global != 0) { uStack_10 = 0; while( true ) { uVar1 = func_0x00400cf0(param_1); if (uVar1 <= uStack_10) break; if (*(char *)(uStack_10 + param_1) == 'S') { printLine(&UNK_004018f9); break; } uStack_10 = uStack_10 + 1; } func_0x00400cb0(param_1); } return; }
['gcc']