logo

etc_portage

Unnamed repository; edit this file 'description' to name the repository. git clone https://hacktivis.me/git/etc_portage.git

musl-1.1.3_gets_GTFO.patch (786B)


  1. diff --git a/src/stdio/gets.c b/src/stdio/gets.c
  2. --- a/src/stdio/gets.c
  3. +++ b/src/stdio/gets.c
  4. @@ -1,15 +1,6 @@
  5. -#include "stdio_impl.h"
  6. -#include <limits.h>
  7. -#include <string.h>
  8. +#include <stdlib.h>
  9. char *gets(char *s)
  10. {
  11. - size_t i=0;
  12. - int c;
  13. - FLOCK(stdin);
  14. - while ((c=getc_unlocked(stdin)) != EOF && c != '\n') s[i++] = c;
  15. - s[i] = 0;
  16. - if (c != '\n' && (!feof(stdin) || !i)) s = 0;
  17. - FUNLOCK(stdin);
  18. - return s;
  19. + abort();
  20. }
  21. diff --git a/include/stdio.h b/include/stdio.h
  22. --- a/include/stdio.h
  23. +++ b/include/stdio.h
  24. @@ -99,9 +99,6 @@ int putc(int, FILE *);
  25. int putchar(int);
  26. char *fgets(char *__restrict, int, FILE *__restrict);
  27. -#if __STDC_VERSION__ < 201112L
  28. -char *gets(char *);
  29. -#endif
  30. int fputs(const char *__restrict, FILE *__restrict);
  31. int puts(const char *);