Possible problems found by static analysis of code.
[platform/upstream/net-tools.git] / lib / x25.c
index d795ca9..2ea0ac8 100644 (file)
--- a/lib/x25.c
+++ b/lib/x25.c
@@ -78,7 +78,7 @@ X25_sprint(struct sockaddr *sap, int numeric)
 static int
 X25_input(int type, char *bufp, struct sockaddr *sap)
 {
-  unsigned char *ptr;
+  char *ptr;
   char *p;
   unsigned int sigdigits;
 
@@ -105,7 +105,8 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
   }
 
   if (strlen(bufp) < 1 || strlen(bufp) > 15 || sigdigits > strlen(bufp)) {
-       *p = '/';
+        if (p != NULL)
+                *p = '/';
         strcpy(X25_errmsg, _("Invalid address"));
 #ifdef DEBUG
         fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);