Mercurial > libpst
comparison src/pst2ldif.cpp @ 41:183ae993b9ad
security fix for potential buffer overrun in lz decompress
author | carl |
---|---|
date | Tue, 02 Oct 2007 15:49:44 -0700 |
parents | f5c024aa1dc5 |
children | b2a7f2e0926a |
comparison
equal
deleted
inserted
replaced
40:be6d5329cc01 | 41:183ae993b9ad |
---|---|
74 }; | 74 }; |
75 // define our set | 75 // define our set |
76 typedef set<char *, ltstr> string_set; | 76 typedef set<char *, ltstr> string_set; |
77 // make a static set to hold the cn values | 77 // make a static set to hold the cn values |
78 static string_set all_strings; | 78 static string_set all_strings; |
79 | |
80 | |
81 //////////////////////////////////////////////// | |
82 // helper to free all the strings in a set | |
83 // | |
84 static void free_strings(string_set &s); | |
85 static void free_strings(string_set &s) | |
86 { | |
87 for (string_set::iterator i=s.begin(); i!=s.end(); i++) { | |
88 free(*i); | |
89 } | |
90 s.clear(); | |
91 } | |
79 | 92 |
80 | 93 |
81 //////////////////////////////////////////////// | 94 //////////////////////////////////////////////// |
82 // helper to register a string in a string set | 95 // helper to register a string in a string set |
83 // | 96 // |
441 printf("objectClass: %s\n\n", ldap_class); | 454 printf("objectClass: %s\n\n", ldap_class); |
442 | 455 |
443 process(d_ptr->child); // do the children of TOPF | 456 process(d_ptr->child); // do the children of TOPF |
444 pst_close(&pstfile); | 457 pst_close(&pstfile); |
445 DEBUG_RET(); | 458 DEBUG_RET(); |
459 free_strings(all_strings); | |
446 return 0; | 460 return 0; |
447 } | 461 } |
448 | 462 |
449 | 463 |
450 int usage() { | 464 int usage() { |