Changeset ddacb9c
- Timestamp:
- Jun 16, 2008, 1:52:24 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- e2257be
- Parents:
- f151757
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rdd28b51 rddacb9c 2 2 3 3 1.0.2 4 * Fix a segfault on retrieving zephyr subs when the user doesn't 5 have any or has expired tickets. -asedeno 4 6 * Don't complain about non-existant ~/.owl/startup when starting. -asedeno 5 7 -
zephyr.c
r02f55dc rddacb9c 1008 1008 #ifdef HAVE_LIBZEPHYR 1009 1009 int ret, num, i, one; 1010 int buffsize; 1010 1011 ZSubscription_t sub; 1011 char *out , *tmpbuff;1012 char *out; 1012 1013 one=1; 1013 1014 … … 1015 1016 if (ret==ZERR_TOOMANYSUBS) { 1016 1017 return(owl_strdup("Zephyr: too many subscriptions\n")); 1017 } else if (ret ) {1018 } else if (ret || (num <= 0)) { 1018 1019 return(owl_strdup("Zephyr: error retriving subscriptions\n")); 1019 1020 } 1020 1021 1021 out=owl_malloc(num*500);1022 tmpbuff=owl_malloc(num*500);1022 buffsize = (num + 1) * 50; 1023 out=owl_malloc(buffsize); 1023 1024 strcpy(out, ""); 1024 1025 for (i=0; i<num; i++) { 1025 1026 if ((ret = ZGetSubscriptions(&sub, &one)) != ZERR_NONE) { 1026 1027 owl_free(out); 1027 owl_free(tmpbuff);1028 1028 ZFlushSubscriptions(); 1029 1029 out=owl_strdup("Error while getting subscriptions\n"); 1030 1030 return(out); 1031 1031 } else { 1032 sprintf(tmpbuff, "<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, out); 1032 int tmpbufflen; 1033 char *tmpbuff; 1034 tmpbuff = owl_sprintf("<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, out); 1035 tmpbufflen = strlen(tmpbuff) + 1; 1036 if (tmpbufflen > buffsize) { 1037 char *out2; 1038 buffsize = tmpbufflen * 2; 1039 out2 = owl_realloc(out, buffsize); 1040 if (out2 == NULL) { 1041 owl_free(out); 1042 owl_free(tmpbuff); 1043 ZFlushSubscriptions(); 1044 out=owl_strdup("Realloc error while getting subscriptions\n"); 1045 return(out); 1046 } 1047 out = out2; 1048 } 1033 1049 strcpy(out, tmpbuff); 1034 }1035 }1036 1037 owl_free(tmpbuff); 1050 owl_free(tmpbuff); 1051 } 1052 } 1053 1038 1054 ZFlushSubscriptions(); 1039 1055 return(out);
Note: See TracChangeset
for help on using the changeset viewer.