diff --git a/en/application-dev/js-reference/app-js.md b/en/application-dev/js-reference/app-js.md index aaf73378aced0088c4d499e8575a474c4785c275..11600f86a7423854920fec39c90e6f645eef4dfc 100755 --- a/en/application-dev/js-reference/app-js.md +++ b/en/application-dev/js-reference/app-js.md @@ -3,7 +3,7 @@ You can implement lifecycle logic specific to your application in the **app.js** file. Available application lifecycle functions are as follows: - **onCreate\(\)**: called when an application is created -- **onDestory\(\)**: called when an application is destroyed +- **onDestroy\(\)**: called when an application is destroyed In the following example, logs are printed only in the lifecycle functions . diff --git a/en/contribute/OpenHarmony-Java-secure-coding-guide.md b/en/contribute/OpenHarmony-Java-secure-coding-guide.md index 79a5726cc1192f3faf495e7fcfa3e6f75781df39..c9f95c18e089f471d97b39c70244bb17af5855c2 100644 --- a/en/contribute/OpenHarmony-Java-secure-coding-guide.md +++ b/en/contribute/OpenHarmony-Java-secure-coding-guide.md @@ -507,7 +507,7 @@ public void unzip(FileInputStream zipFileInputStream, String dir) throws IOExcep entryFile = new File(entryFilePath); if (entry.isDirectory()) { - creatDir(entryFile); + createDir(entryFile); continue; } @@ -536,7 +536,7 @@ private String sanitizeFileName(String fileName, String dir) throws IOException throw new IOException("Path Traversal vulnerability: ..."); } -private void creatDir(File dirPath) throws IOException { +private void createDir(File dirPath) throws IOException { boolean result = dirPath.mkdirs(); if (!result) { throw new IOException("Create dir failed, path is : " + dirPath.getPath()); diff --git a/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md b/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md index 2bc5234ca6a8a7a28a0b4f0d2c4eebf0123bcb8c..39d6945ec211060a1a3068315a86d1278e8c1d2d 100755 --- a/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md +++ b/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md @@ -329,7 +329,7 @@ console.log(`${username}'s birthday is ${birthday}`); **Example:** ```javascript -let message = 'wolrd'; +let message = 'world'; console.log(message); ``` diff --git a/en/contribute/OpenHarmony-c-coding-style-guide.md b/en/contribute/OpenHarmony-c-coding-style-guide.md index 6231319194293ad1bfdf9dfd6d51affe408889a1..781b0a169b77c1e318dcb4fb30c8490124e64a08 100755 --- a/en/contribute/OpenHarmony-c-coding-style-guide.md +++ b/en/contribute/OpenHarmony-c-coding-style-guide.md @@ -1966,7 +1966,7 @@ The value is limited by the name, for example, `#define XX_TIMER_INTERVAL_300MS ### Rec 8.1 When comparing expressions, follow the principle that the left side tends to change and the right side tends to remain unchanged. -When a variable is compared with a constant, placing the constant on the left, for example, `if (MAX == v)` does not read naturally, and `if (MAX > v)` is more difficult to understand. +When a variable is compared with a constant, placing the constant on the left, for example, `if (MAX == v)` does not read naturally, and `if (MAX > v)` is more difficult to understand. The constant should be placed on the right according to the normal reading order and habit. The expression is written as follows: ```c diff --git a/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md b/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md index 621953b338c8ca14c1e71d1a670788a544ab22aa..31114039d57f68473980b4d651f5771db16f1899 100644 --- a/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md +++ b/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md @@ -36,8 +36,8 @@ Input validation includes but is not limited to: **External Data Validation Principles 1. Trust boundary** - External data is untrusted. Therefore, if data is transmitted and processed across different trust boundaries during system operation, validity check must be performed on data from modules outside the trust boundaries to prevent attacks from spreading. (a) Different so (or dll) modules - As an independent third-party module, the so or dll module is used to export common API functions for other modules to call. The so/dll module is unable to determine whether the caller passes on valid arguments. Therefore, the common function of the so/dll module needs to check the validity of the arguments provided by the caller. The so/dll module should be designed in low coupling and high reusability. Although the so/dll module is designed to be used only in this software in certain cases, different so/dll modules should still be regarded as different trust boundaries. (b) Different processes + External data is untrusted. Therefore, if data is transmitted and processed across different trust boundaries during system operation, validity check must be performed on data from modules outside the trust boundaries to prevent attacks from spreading. (a) Different so (or dll) modules + As an independent third-party module, the so or dll module is used to export common API functions for other modules to call. The so/dll module is unable to determine whether the caller passes on valid arguments. Therefore, the common function of the so/dll module needs to check the validity of the arguments provided by the caller. The so/dll module should be designed in low coupling and high reusability. Although the so/dll module is designed to be used only in this software in certain cases, different so/dll modules should still be regarded as different trust boundaries. (b) Different processes To prevent privilege escalation through processes with high permissions, the IPC communications between processes (including IPC communications between boards and network communications between hosts) should be regarded as communications across different trust boundaries. (c) Application layer processes and operating system kernel The operating system kernel has higher permissions than the application layer. The interface provided by the kernel for the application layer should process the data from the application layer as untrusted data. (d) Internal and external environments of TEE To prevent attacks from spreading to the TEE, the interfaces provided by the TEE and SGX for external systems should process external data as untrusted data. @@ -2072,7 +2072,7 @@ memset(buffer, 0, SIZE); // Use the requested buffer size. ## Do not directly use external data to concatenate SQL statements **\[Description]** -An SQL injection vulnerability arises when an SQL query is dynamically altered to form an altogether different query. Execution of this altered query may result in information leaks or data tampering. The root cause of SQL injection is the use of external data to concatenate SQL statements. In C/C++, external data is used to concatenate SQL statements in the following scenarios (but not limited to): +An SQL injection vulnerability arises when an SQL query is dynamically altered to form an altogether different query. Execution of this altered query may result in information leaks or data tampering. The root cause of SQL injection is the use of external data to concatenate SQL statements. In C/C++, external data is used to concatenate SQL statements in the following scenarios (but not limited to): - Argument for calling **mysql\_query()** and **Execute()** when connecting to MySQL - Argument for calling **dbsqlexec()** of the db-library driver when connecting to the SQL server diff --git a/en/contribute/OpenHarmony-cpp-coding-style-guide.md b/en/contribute/OpenHarmony-cpp-coding-style-guide.md index 8a7ecbad0ca50c514f6b14380fca47613f505468..9471318f4b227c28bb15a6568b7442a83f93f1d2 100755 --- a/en/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/en/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -2321,7 +2321,7 @@ The default constructor, destructor, `swap` function, and `move` operator should Template programming allows for extremely flexible interfaces that are type safe and high performance, enabling reuse of code of different types but with the same behavior. -The disadvantages of template proramming are as follows: +The disadvantages of template programming are as follows: 1. The techniques used in template programming are often obscure to anyone but language experts. Code that uses templates in complicated ways is often unreadable, and is hard to debug or maintain. 2. Template programming often leads to extremely poor compiler time error messages: even if an interface is simple, complicated implementation details become visible when the user does something wrong. diff --git a/en/device-dev/driver/driver-service-management.md b/en/device-dev/driver/driver-service-management.md index 961fceb1181222a71d1423c5f0eebe22e07da3c6..833d233b6723f92b9227eaa04ffc6998fbec2cf9 100644 --- a/en/device-dev/driver/driver-service-management.md +++ b/en/device-dev/driver/driver-service-management.md @@ -128,7 +128,7 @@ The development of driver service management includes compiling, binding, obtain - Using the subscription mechanism - If the kernel sapce unaware of the time for loading drivers \(on the same host\), use the subscription mechanism provided by the HDF to subscribe to the drivers. After the drivers are loaded, the HDF releases the driver services to you. The implementation is as follows: + If the kernel space unaware of the time for loading drivers \(on the same host\), use the subscription mechanism provided by the HDF to subscribe to the drivers. After the drivers are loaded, the HDF releases the driver services to you. The implementation is as follows: ``` // Subscription callback function. After the subscribed drivers are loaded, the HDF releases the driver services to you using this function. diff --git a/en/device-dev/driver/watchdogusage-example.md b/en/device-dev/driver/watchdogusage-example.md index 98f6acfa0e383b059ed257df8411ef03f3f9ee72..43943a038ad5bbdeddd29351d263d03ce0925deb 100644 --- a/en/device-dev/driver/watchdogusage-example.md +++ b/en/device-dev/driver/watchdogusage-example.md @@ -52,7 +52,7 @@ static int32_t TestCaseWatchdog(void) /* Start the watchdog. The timer starts. */ ret = WatchdogStart(handle); if (ret != HDF_SUCCESS) { - HDF_LOGE("%s: satrt fail! ret:%d\n", __func__, ret); + HDF_LOGE("%s: start fail! ret:%d\n", __func__, ret); WatchdogClose(handle); return ret; } @@ -73,7 +73,7 @@ static int32_t TestCaseWatchdog(void) /* Enable the timer to expire by stopping feeding the watchdog. */ for (i = 0; i < WATCHDOG_TEST_FEED_TIME; i++) { - HDF_LOGE("%s: watiting dog buck %d times... \n", __func__, i); + HDF_LOGE("%s: waiting dog buck %d times... \n", __func__, i); OsalSleep(1); } diff --git a/en/device-dev/guide/faqs.md b/en/device-dev/guide/faqs.md index 1a8fa2eae8d539e023e1914ca6b586efc9fe6d69..14afd9f8ecc2d094fe8d632dc05372dc9356e9da 100644 --- a/en/device-dev/guide/faqs.md +++ b/en/device-dev/guide/faqs.md @@ -12,7 +12,7 @@