examples: length-limit two sscanf() uses of %s

Reported-by: Jishan Shaikh
Fixes #7293
Closes #7294
This commit is contained in:
Daniel Stenberg 2021-06-24 09:24:37 +02:00
parent 0842175fa4
commit 42db4ccee2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 3 additions and 3 deletions

View file

@ -173,7 +173,7 @@ static void get_media_control_attribute(const char *sdp_filename,
control[0] = '\0';
if(sdp_fp != NULL) {
while(fgets(s, max_len - 2, sdp_fp) != NULL) {
sscanf(s, " a = control: %s", control);
sscanf(s, " a = control: %32s", control);
}
fclose(sdp_fp);
}