]> granicus.if.org Git - musl/commitdiff
fix typo in table for getprotoent that caused out-of-bound reads
authorRich Felker <dalias@aerifal.cx>
Thu, 13 Feb 2014 17:24:40 +0000 (12:24 -0500)
committerRich Felker <dalias@aerifal.cx>
Thu, 13 Feb 2014 17:24:40 +0000 (12:24 -0500)
this was unlikely to lead to any crash or dangerous behavior, but
caused adjacent string constants to be treated as part of the
protocols table, possibly returning nonsensical results for unknown
protocol names/numbers or when getprotoent was called in a loop to
enumerate all protocols.

src/network/proto.c

index 031003ad0cf490b4e2e01714e27d179693e51553..c569232f5a0ad9429948abc16fd5910c7dffcc86 100644 (file)
@@ -13,7 +13,7 @@ static const unsigned char protos[][6] = {
        "\014pup",
        "\021udp",
        "\026idp",
-       "\377raw"
+       "\377raw",
        "\0\0"
 };