-
Notifications
You must be signed in to change notification settings - Fork 113
feat(esp_commands): add esp_commands component (IEC-338) #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(esp_commands): add esp_commands component (IEC-338) #530
Conversation
5154826
to
a58eaa6
Compare
a58eaa6
to
7aaddae
Compare
7aaddae
to
626c620
Compare
916dbc7
to
7bb19c4
Compare
7bb19c4
to
cf00766
Compare
7f8ef19
to
1469d38
Compare
1469d38
to
19173a7
Compare
df4b49a
to
aa5a2ca
Compare
aa5a2ca
to
253c3a7
Compare
253c3a7
to
a70f444
Compare
a70f444
to
20b701d
Compare
20b701d
to
9873ad4
Compare
92b1065
to
c1b8f4a
Compare
41b027d
to
db1c4ce
Compare
db1c4ce
to
4388498
Compare
return ESP_ERR_INVALID_ARG; | ||
} | ||
|
||
memcpy(&s_config, config, sizeof(s_config)); |
Check warning
Code scanning / clang-tidy
Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
*/ | ||
FDPRINTF(fd_out, "%-s", it->name); | ||
if (it->hint_cb) { | ||
FDPRINTF(fd_out, " %s\n", it->hint_cb(it->func_ctx)); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
if (it->hint_cb) { | ||
FDPRINTF(fd_out, " %s\n", it->hint_cb(it->func_ctx)); | ||
} else { | ||
FDPRINTF(fd_out, "\n"); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
* help cmd_name -v 0 */ | ||
if (argc <= 0 || argc > 4) { | ||
/* unknown issue, return error */ | ||
FDPRINTF(fd_out, "help: invalid number of arguments %d\n", argc); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
/* check if the following argument is either 0, or 1 */ | ||
if (i + 1 >= argc) { | ||
/* format error, return with error */ | ||
FDPRINTF(fd_out, "help: arguments not provided in the right format\n"); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
verbose_level = 1; | ||
} else { | ||
/* wrong command format, return error */ | ||
FDPRINTF(fd_out, "help: invalid verbose level %s\n", argv[i + 1]); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
go_through_commands(cmd_sets, &ctx, call_command_funcs); | ||
|
||
if (command_name && !ctx.command_found) { | ||
FDPRINTF(fd_out, "help: invalid command name %s\n", command_name); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
d8ce859
to
448dec2
Compare
/* First line: command name and hint | ||
* Pad all the hints to the same column | ||
*/ | ||
FDPRINTF(fd_out, "%-s", it->name); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
/* TODO: replace the simple print with a function that | ||
* replaces arg_print_formatted */ | ||
if (it->help) { | ||
FDPRINTF(fd_out, " %s\n", it->help); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
if (it->help) { | ||
FDPRINTF(fd_out, " %s\n", it->help); | ||
} else { | ||
FDPRINTF(fd_out, " -\n"); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
|
||
static void print_arg_command(const int fd_out, esp_command_t *it) | ||
{ | ||
FDPRINTF(fd_out, "%-s", it->name); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
448dec2
to
5f20bcc
Compare
if (it->hint_cb) { | ||
const char *hint = it->hint_cb(it->func_ctx); | ||
if (hint) { | ||
FDPRINTF(fd_out, " %s", it->hint_cb(it->func_ctx)); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
} | ||
} | ||
|
||
FDPRINTF(fd_out, "\n"); |
Check warning
Code scanning / clang-tidy
Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning
Checklist
url
field definedChange description
Please describe your change here