Project

General

Profile

Bug #3319 ยป 19894.c

Code demonstrating issue - tonyc, 06/29/2022 06:05 PM

 
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

int main(void) {
char buf[200];
pid_t p = getpid();
snprintf(buf, sizeof(buf), "ps -o command= -p %ld", (long)p);
#ifdef MANY
setproctitle("-\xC3");
setproctitle("-haha\304\200hoho");
setproctitle("-");
setproctitle("-alpha");
setproctitle("-haha\304\200hoho");
setproctitle("-");
setproctitle("-haha\304\200hoho-redux");
setproctitle("-haha\304\200hoho");
setproctitle("-aaaa");
setproctitle("-");
//setproctitle("-haha\304\200hoho-redux");
//setproctitle("-aaaa");
//setproctitle("-bar");
#endif
setproctitle("-x");
system(buf);
return 0;
}
    (1-1/1)