Fix bug in table allocation.
authorPawel Polawski <p.polawski@partner.samsung.com>
Tue, 5 Mar 2013 10:28:38 +0000 (11:28 +0100)
committerPawel Polawski <p.polawski@partner.samsung.com>
Tue, 5 Mar 2013 10:56:59 +0000 (11:56 +0100)
[Issue#]        N/A
[Bug]           Wrong pointer passed to allocating fuinction
[Cause]         N/A
[Soultion]      Changed to correct pointer
[Verification]  No warnings while compilation

Change-Id: I54d00e11862f1986b0518009bdb30a5942f127b7

src/communication/security-server-comm.c
src/server/security-server-main.c

index e83a14a..59681f2 100644 (file)
@@ -2427,7 +2427,7 @@ error:
 }
 
 /* Get app PID from socked and read its privilege (GID) list
- * from /proc/<PDI>/status.
+ * from /proc/<PID>/status.
  *
  * param 1: socket descriptor
  * param 2: pointer for hold returned array
@@ -2451,7 +2451,7 @@ int get_client_gid_list(int sockfd, int ** privileges)
     //file pointer
     FILE * fp = NULL;
     //buffer for filelines
-    const int LINESIZE = 128;
+    const int LINESIZE = 256;
     char fileLine[LINESIZE];
     //for parsing file
     char delim[] = ": ";
index 34d4f2a..a9220fb 100644 (file)
@@ -716,7 +716,7 @@ int process_pid_request(int sockfd)
 {
        int retval, client_pid;
        unsigned char requested_cookie[SECURITY_SERVER_COOKIE_LEN];
-    int * privileges;
+    int * privileges = NULL;
        cookie_list *search_result = NULL;
 
        /* Authenticate client */
@@ -793,7 +793,7 @@ error:
 int process_smack_request(int sockfd)
 {
     int retval, client_pid;
-    int privileges[1];
+    int * privileges = NULL;
     unsigned char requested_cookie[SECURITY_SERVER_COOKIE_LEN];
     cookie_list *search_result = NULL;
     //handler for SMACK label