int my_filewrite(char *question) {
char filename[100];
int fd;
printf(question);
scanf("%s", filename);

if (strlen(filename) > 100) }

return 0;

please can you help to find potential vulnerabilities in this code? Thank you.

EDIT This looks like a quiz question.

Are you asking for help on a quiz/test/homework?

yes, it is for exam. If you can help, it will be great.

As per Community Rules we are a help forum.

Therefore, we can not simply answer questions for you.

We can, however, point you to things to help you learn as Moschops has.

Mate, I know little about C, my programing is not good. If I had time, I would figure out but now I don't have so much time...so please if you know which line creates vulnerability, please write. I will appreciate a lot.

ok keep your knowledge to yourself, I can learn by myself. Later I will not need forums to learn. I will use forum to help people, even it requires to write by line by explanations.

Later I will not need forums to learn.

Cheating != learning

Learning is encouraged here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.