// buggy.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void copy_input(const char *input) {
    char *buffer = (char *)malloc(100);
    strcpy(buffer, input);  // Possible overflow
    printf("Copied: %s\n", buffer);
    free(buffer);
}

void call_uninit() {
    char *p=malloc(100);
    strcpy(p, "Danger!");  // Using uninitialized pointer
}

int main() {
    copy_input("This input is too long for the buffer!");
    call_uninit();

    char *leak = malloc(100);
    strcpy(leak, "Memory not freed");  // Leak here

    return 0;
}
