Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH 1/4] util: add bounds check to util_get_{domain,username}
@ 2019-10-16 23:43 James Prestwood
  2019-10-16 23:43 ` [PATCH 2/4] eapol: reorder eapol_sm_free James Prestwood
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: James Prestwood @ 2019-10-16 23:43 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

---
 src/util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util.c b/src/util.c
index f787ce6b..f1860a33 100644
--- a/src/util.c
+++ b/src/util.c
@@ -176,7 +176,7 @@ const char *util_get_domain(const char *identity)
 			strncpy(domain, identity, c - identity);
 			return domain;
 		case '@':
-			strcpy(domain, c + 1);
+			strncpy(domain, c + 1, sizeof(domain));
 			return domain;
 		default:
 			continue;
@@ -197,7 +197,7 @@ const char *util_get_username(const char *identity)
 	for (c = identity; *c; c++) {
 		switch (*c) {
 		case '\\':
-			strcpy(username, c + 1);
+			strncpy(username, c + 1, sizeof(username));
 			return username;
 		case '@':
 			strncpy(username, identity, c - identity);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-17  2:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-16 23:43 [PATCH 1/4] util: add bounds check to util_get_{domain,username} James Prestwood
2019-10-16 23:43 ` [PATCH 2/4] eapol: reorder eapol_sm_free James Prestwood
2019-10-17  2:18   ` Denis Kenzior
2019-10-16 23:43 ` [PATCH 3/4] eapol: check return of ie_parse_rsne_from_data James Prestwood
2019-10-17  2:25   ` Denis Kenzior
2019-10-16 23:43 ` [PATCH 4/4] ie: reorder ie_parse_osen to fix uninitialized value James Prestwood
2019-10-17  2:25   ` Denis Kenzior
2019-10-17  2:15 ` [PATCH 1/4] util: add bounds check to util_get_{domain,username} Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox