summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/dns.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 7a91223394..3e08c54c2e 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -394,10 +394,14 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
case T_HINFO:
/* See RFC 1010 for values */
add_assoc_string(*subarray, "type", "HINFO", 1);
- GETSHORT(n, cp);
- add_assoc_long(*subarray, "cpu", n);
- GETSHORT(n, cp);
- add_assoc_long(*subarray, "os", n);
+ n = *cp & 0xFF;
+ cp++;
+ add_assoc_stringl(*subarray, "cpu", cp, n, 1);
+ cp += n;
+ n = *cp & 0xFF;
+ cp++;
+ add_assoc_stringl(*subarray, "os", cp, n, 1);
+ cp += n;
break;
case T_TXT:
add_assoc_string(*subarray, "type", "TXT", 1);