1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
ZyXEL_PMG5617GA/package/libs/clinkc/patches/045-BUGFIX_http_cookie_set.patch
2022-11-27 10:16:14 +00:00

32 lines
1.1 KiB
Diff

Index: clinkc/src/cybergarage/http/chttp_cookie.c
===================================================================
--- clinkc.orig/src/cybergarage/http/chttp_cookie.c 2015-04-16 20:14:57.392286635 +0800
+++ clinkc/src/cybergarage/http/chttp_cookie.c 2015-04-16 20:16:44.359262600 +0800
@@ -32,6 +32,12 @@
strncpy( name, attr, SIZE_COOKIE_NAME );
}
+ /*The NAME=VALUE attribute-value pair MUST come first in each cookie.*/
+ if(strlen(value)>0 && strlen(cookiedata->name)==0){
+ strncpy(cookiedata->name, name, SIZE_COOKIE_NAME);
+ strncpy(cookiedata->value, value, SIZE_COOKIE_VALUE);
+ }
+
if(strcasecmp(name, CG_HTTP_COOKIE_COMMENT)==0 && strlen(value)>0 ){
strncpy(cookiedata->comment, value, SIZE_COOKIE_COMMENT);
}
@@ -66,13 +72,6 @@
else if(strcasecmp(name, CG_HTTP_COOKIE_AUTH)==0 && strlen(value)>0 ){
strncpy(cookiedata->authentication, value, SIZE_COOKIE_AUTH);
}
- else{
- /*The NAME=VALUE attribute-value pair MUST come first in each cookie.*/
- if(strlen(value)>0 && strlen(cookiedata->name)==0){
- strncpy(cookiedata->name, name, SIZE_COOKIE_NAME);
- strncpy(cookiedata->value, value, SIZE_COOKIE_VALUE);
- }
- }
}