Commit 75c3926d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix typo when parsing IPv4 prefixes with omitted butes.

parent 1732bc83
...@@ -90,7 +90,7 @@ network_prefix(int ae, int plen, unsigned int omitted, ...@@ -90,7 +90,7 @@ network_prefix(int ae, int plen, unsigned int omitted,
if (dp == NULL || !v4mapped(dp)) return -1; if (dp == NULL || !v4mapped(dp)) return -1;
memcpy(prefix, dp, 12 + omitted); memcpy(prefix, dp, 12 + omitted);
} }
if(pb > omitted) memcpy(prefix + 12 + omitted, p, pb); if(pb > omitted) memcpy(prefix + 12 + omitted, p, pb - omitted);
break; break;
case 2: case 2:
if(omitted > 16 || (pb > omitted && len < pb - omitted)) return -1; if(omitted > 16 || (pb > omitted && len < pb - omitted)) return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment