[CA-Integration]: Temporary fix for stack smashing and fix support for "/"
authorSashi Penta <sashi.kumar.penta@intel.com>
Sat, 20 Dec 2014 07:48:07 +0000 (23:48 -0800)
committerSashi Penta <sashi.kumar.penta@intel.com>
Sat, 20 Dec 2014 07:48:07 +0000 (23:48 -0800)
Change-Id: I54b9e4f8b51981094c8d78145510d3e865413f58
Signed-off-by: Sashi Penta <sashi.kumar.penta@intel.com>
resource/csdk/connectivity/build/linux/Makefile
resource/csdk/connectivity/src/caremotehandler.c
resource/csdk/stack/src/ocresource.c

index edf85e2..5158ebb 100644 (file)
@@ -81,8 +81,8 @@ libtiny_lib_dir = $(PROJECT_LIB_PATH)/extlibs/tinydtls
 LDFLAGS := -L$(libcoap_build_dir) -L$(libtiny_lib_dir)
 LDLIBS := -lcoap -ltinydtls
 else
-LDFLAGS := -L$(libcoap_build_dir) 
-LDLIBS := -lcoap 
+LDFLAGS := -L$(libcoap_build_dir)
+LDLIBS := -lcoap
 
 endif
 BUILD_FLAG.debug = $(DEFINE_FLAG) $(DEBUG_FLAG)
@@ -110,7 +110,8 @@ COMPONENT_OBJS = $(COMPONENT_SRCS:%.c=$(OBJ_DIR)/%.o)
 ##
 ##     compiler flags
 ##
-CFLAGS = -g -c -Wall -fPIC `pkg-config --cflags glib-2.0`
+#TODO-CA Remove -fstack-protector-all before merging to master
+CFLAGS = -g -c -Wall -fstack-protector-all -fPIC `pkg-config --cflags glib-2.0`
 LFLAGS = -ldl -lpthread `pkg-config --libs glib-2.0`
 IFLAGS = -I$(PROJECT_COMMON_INC_PATH)  \
        -I$(PROJECT_API_PATH)   \
@@ -119,7 +120,7 @@ IFLAGS = -I$(PROJECT_COMMON_INC_PATH)       \
        -I$(WIFI_ADAPTER_PATH)  \
        -I$(BT_ADAPTER_PATH)    \
        -I$(BLE_ADAPTER_PATH)   \
-        -I$(libcoap_build_dir) 
+        -I$(libcoap_build_dir)
 
 ifeq ($(DTLS),1)
        IFLAGS += -I$(libtiny_lib_dir)
index d888034..011b170 100644 (file)
@@ -391,7 +391,7 @@ CAResponseInfo_t *CACloneResponseInfo(const CAResponseInfo_t *rep)
         clone->info.token = temp;
     }
 
-    if (rep->info.options != NULL)
+    if (rep->info.options != NULL && rep->info.numOptions)
     {
         // save the options
         clone->info.options = (CAHeaderOption_t *) OICMalloc(sizeof(CAHeaderOption_t));
index 95c1f56..ec7c179 100644 (file)
 extern OCResource *headResource;
 
 static const char * VIRTUAL_RSRCS[] = {
-// TODO-CA We will use the regular path once CA fixes this issue
-#ifdef CA_INT
-       "oc/core",
-       "oc/core/d",
-       "oc/core/types/d",
-       #ifdef WITH_PRESENCE
-       "oc/presence"
-       #endif
-#else
        "/oc/core",
        "/oc/core/d",
        "/oc/core/types/d",
        #ifdef WITH_PRESENCE
        "/oc/presence"
        #endif
-#endif
 };
 
 //-----------------------------------------------------------------------------