Exploit databaseDownload repository ZIP
GH-d879f8fbd49e794749f87fba32e9a2ac
helica-core/eap_pwn
Sources for CVE-2023-52160
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files63
helica-core/eap_pwnRevision f17536590df8
- ↑..Parent directory
- Makefile
- base64.c
- base64.h
- bitfield.c
- bitfield.h
- browser-android.c
- browser-system.c
- browser-wpadebug.c
- browser.c
- browser.h
- build_config.h
- common.c
- common.h
- config.c
- config.h
- const_time.h
- crc32.c
- crc32.h
- edit.c
- edit.h
- edit_readline.c
- edit_simple.c
- eloop.c
- eloop.h
- eloop_win.c
- ext_password.c
- ext_password.h
- ext_password_file.c
- ext_password_i.h
- ext_password_test.c
- http-utils.h
- http_curl.c
- includes.h
- ip_addr.c
- ip_addr.h
- json.c
- json.h
- list.h
- module_tests.h
- os.h
- os_internal.c
- os_none.c
- os_unix.c
- os_win32.c
- pcsc_funcs.c
- pcsc_funcs.h
- platform.h
- radiotap.c
- radiotap.h
- radiotap_iter.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/utils/config.c
C · 2,078 bytes/*
* Configuration parsing
* Copyright (c) 2003-2019, Jouni Malinen <[email protected]>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#include "includes.h"
#include "utils/config.h"
#include "common.h"
static int newline_terminated(const char *buf, size_t buflen)
{
size_t len = os_strlen(buf);
if (len == 0)
return 0;
if (len == buflen - 1 && buf[buflen - 1] != '\r' &&
buf[len - 1] != '\n')
return 0;
return 1;
}
static void skip_line_end(FILE *stream)
{
char buf[100];
while (fgets(buf, sizeof(buf), stream)) {
buf[sizeof(buf) - 1] = '\0';
if (newline_terminated(buf, sizeof(buf)))
return;
}
}
char * wpa_config_get_line(char *s, int size, FILE *stream, int *line,
char **_pos)
{
char *pos, *end, *sstart;
while (fgets(s, size, stream)) {
(*line)++;
s[size - 1] = '\0';
if (!newline_terminated(s, size)) {
/*
* The line was truncated - skip rest of it to avoid
* confusing error messages.
*/
wpa_printf(MSG_INFO, "Long line in configuration file "
"truncated");
skip_line_end(stream);
}
pos = s;
/* Skip white space from the beginning of line. */
while (*pos == ' ' || *pos == '\t' || *pos == '\r')
pos++;
/* Skip comment lines and empty lines */
if (*pos == '#' || *pos == '\n' || *pos == '\0')
continue;
/*
* Remove # comments unless they are within a double quoted
* string.
*/
sstart = pos;
end = os_strchr(sstart, '#');
while (end) {
sstart = os_strchr(sstart, '"');
if (!sstart || sstart > end)
break;
sstart = os_strchr(sstart + 1, '"');
if (!sstart)
break;
sstart++;
if (sstart > end)
end = os_strchr(sstart, '#');
}
if (end)
*end-- = '\0';
else
end = pos + os_strlen(pos) - 1;
/* Remove trailing white space. */
while (end > pos &&
(*end == '\n' || *end == ' ' || *end == '\t' ||
*end == '\r'))
*end-- = '\0';
if (*pos == '\0')
continue;
if (_pos)
*_pos = pos;
return pos;
}
if (_pos)
*_pos = NULL;
return NULL;
}