Commit 571b0b3
committed
fix problem with 0-length string
message: Non-initialized "ptr" is passed to "lua_pushlstring" as const
When input length is zero the transformation loop does not run,
leaving buffer contents uninitialized. Although lua_pushlstring with
length 0 would not read from ptr, some static analyzers flag this as
use of uninitialized data. Provide explicit fast-path for n==0 to
make intent clear and silence warnings (CERT_C-EXP33-a-1).1 parent bf05c16 commit 571b0b3
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
| |||
0 commit comments