chiark / gitweb /
socket: prevent signed integer overflow
authorDave Reisner <dreisner@archlinux.org>
Sat, 15 Sep 2012 16:58:48 +0000 (12:58 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 16 Sep 2012 14:55:46 +0000 (16:55 +0200)
src/core/socket.c:588:25: error: overflow in implicit constant conversion
src/core/socket.c:589:17: error: overflow in implicit constant conversion

src/core/socket.c

index cbbfb0c..f975a43 100644 (file)
@@ -584,7 +584,7 @@ static int instance_from_socket(int fd, unsigned nr, char **instance) {
         }
 
         case AF_INET6: {
-                static const char ipv4_prefix[] = {
+                static const unsigned char ipv4_prefix[] = {
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF
                 };