1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 2f08c3bdfSopenharmony_ci/* 3f08c3bdfSopenharmony_ci * Copyright (c) 2017 Veronika Kabatova <vkabatov@redhat.com> 4f08c3bdfSopenharmony_ci */ 5f08c3bdfSopenharmony_ci 6f08c3bdfSopenharmony_ci/* 7f08c3bdfSopenharmony_ci * Test for cecbd0cb3 ("Fix buffer overflow in print_result() function") 8f08c3bdfSopenharmony_ci */ 9f08c3bdfSopenharmony_ci 10f08c3bdfSopenharmony_ci#include <stdlib.h> 11f08c3bdfSopenharmony_ci#include "tst_test.h" 12f08c3bdfSopenharmony_ci 13f08c3bdfSopenharmony_ci#define TEXT "The only purpose of this text si to try to overflow the buffers "\ 14f08c3bdfSopenharmony_ci "in test library, other than that it does not include any useful "\ 15f08c3bdfSopenharmony_ci "information. Whoever decides to read this wall of text is just " \ 16f08c3bdfSopenharmony_ci "simply wasting his time. You are not reading this are you? Hmm " \ 17f08c3bdfSopenharmony_ci "you still do. Are you feeling rebelious today? Well whatever. " \ 18f08c3bdfSopenharmony_ci "It's _your_ time not mine. Feel free to waste it if you want " \ 19f08c3bdfSopenharmony_ci "to. Still reading? I bet you are not. And don't try to prove me "\ 20f08c3bdfSopenharmony_ci "wrong just because you can. Still reading? Do you feel better "\ 21f08c3bdfSopenharmony_ci "now? Now even I am bored, how come that can you still continue "\ 22f08c3bdfSopenharmony_ci "reading? And now for something completely different! Let's try "\ 23f08c3bdfSopenharmony_ci "some ASCII art! This is a sitting mouse from a top: <3)~~ Did "\ 24f08c3bdfSopenharmony_ci "like that? No? Hmm, let me think, I think I can draw a pengiun "\ 25f08c3bdfSopenharmony_ci "as well what about this one: <(^) ? You liked the mouse better? "\ 26f08c3bdfSopenharmony_ci "Why I'm even trying? Anyway I'm pretty sure nobody got here, so "\ 27f08c3bdfSopenharmony_ci "I will write down a secret. It will be burried here forever and "\ 28f08c3bdfSopenharmony_ci "ever until brave adventurer decides to read this paragraph to "\ 29f08c3bdfSopenharmony_ci "the very end. Here it comes: the text was long enough even "\ 30f08c3bdfSopenharmony_ci "before I added this sentence, therefore this sentence is as "\ 31f08c3bdfSopenharmony_ci "useless as it can be, yet it exists here, sometimes strange "\ 32f08c3bdfSopenharmony_ci "things like this happens..." 33f08c3bdfSopenharmony_ci 34f08c3bdfSopenharmony_cistatic void run(void) 35f08c3bdfSopenharmony_ci{ 36f08c3bdfSopenharmony_ci tst_res(TPASS, TEXT); 37f08c3bdfSopenharmony_ci tst_res(TPASS | TERRNO, TEXT); 38f08c3bdfSopenharmony_ci} 39f08c3bdfSopenharmony_ci 40f08c3bdfSopenharmony_cistatic struct tst_test test = { 41f08c3bdfSopenharmony_ci .test_all = run, 42f08c3bdfSopenharmony_ci}; 43