-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c565e6f
commit babdf3f
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
external/stdk/patch/0001-Modify-array-index-in-for-loop-avoid-overwrite.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 477f4bb09cb372cba3d796151390c033d131b9a1 Mon Sep 17 00:00:00 2001 | ||
From: "qin.li" <[email protected]> | ||
Date: Wed, 30 Oct 2019 15:45:04 +0800 | ||
Subject: [PATCH] Modify array index in for loop, avoid overwrite | ||
|
||
--- | ||
src/easysetup/iot_easysetup_d2d.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/easysetup/iot_easysetup_d2d.c b/src/easysetup/iot_easysetup_d2d.c | ||
index 2d55f60..51e3085 100644 | ||
--- a/src/easysetup/iot_easysetup_d2d.c | ||
+++ b/src/easysetup/iot_easysetup_d2d.c | ||
@@ -444,7 +444,7 @@ static iot_error_t _es_keyinfo_handler(struct iot_context *ctx, char *in_payload | ||
goto exit; | ||
} | ||
|
||
- for (i = 0, j = 0; i < sizeof(rand_asc); i += 2, j++) { | ||
+ for (i = 0, j = 0; i < sizeof(rand_asc) - 1; i += 2, j++) { | ||
memcpy(tmp, rand_asc + i, 2); | ||
val = (unsigned char)strtol((const char *)tmp, NULL, 16); | ||
key_rand[j] = val; | ||
-- | ||
2.7.4 | ||
|
Submodule st-device-sdk-c
added at
7c1548