Skip to content

Commit

Permalink
demos: Fix unbounded write in sscanf call (#1859)
Browse files Browse the repository at this point in the history
Buffer write operations that do not control the length of data written may overflow.
  • Loading branch information
szsam authored Mar 31, 2023
1 parent 29aea9b commit c0b9f1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demos/defender/defender_demo_json/metrics_collector.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ MetricsCollectorStatus_t GetNetworkInferfaceInfo( char ( *pOutNetworkInterfaceNa
LogDebug( ( "File: /proc/net/arp, Content: %s.", &( lineBuffer[ 0 ] ) ) );

filledVariables = sscanf( lineBuffer,
"%u.%u.%u.%u %*s %*s %*s %*s %s",
"%u.%u.%u.%u %*s %*s %*s %*s %15s",
&ipPart1,
&ipPart2,
&ipPart3,
Expand Down

0 comments on commit c0b9f1e

Please sign in to comment.