opened
monocle-ai
username_0
<span> What is a&nbsp;</span><span><b>Conditionally Uninitialized Variable? </b></span><span> The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.</span>
---

1 instance of this defect were found in the following locations:
---
**Instance 1**
File : `lib/sendf.c` 
Function: `curl_mvsnprintf` 
https://github.com/curl/curl/blob/17b1405b20f7ea916995c224992b0ec592f73039/lib/sendf.c#L270
Code extract:

```cpp
    size_t len;
    char error[CURL_ERROR_SIZE + 2];
    va_start(ap, fmt);
    mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap); <------ HERE
    len = strlen(error);

```

**How can I fix it?** 
Correct reference usage found in `lib/sendf.c` at line `241`.
https://github.com/curl/curl/blob/17b1405b20f7ea916995c224992b0ec592f73039/lib/sendf.c#L241
Code extract:

```cpp
    size_t len;
    char print_buffer[2048 + 1];
    va_start(ap, fmt);
    len = mvsnprintf(print_buffer, sizeof(print_buffer), fmt, ap); <------ HERE
    /*
     * Indicate truncation of the input by replacing the last 3 characters
```
Potential security issue in lib/sendf.c: Unchecked return from initialization function
issue
closed
bagder
username_1
issue