OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../heimdal/hdb-ldap-malloc.patch
  5. # Copyright (C) 2008 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Index: heimdal/lib/hdb/hdb-ldap.c
  17. ===================================================================
  18. --- heimdal/lib/hdb/hdb-ldap.c (revision 22587)
  19. +++ heimdal/lib/hdb/hdb-ldap.c (revision 22588)
  20. @@ -989,8 +989,10 @@
  21. goto out;
  22. }
  23. for (i = 0; i < ent->entry.etypes->len; i++) {
  24. - char buf[100];
  25. - if (vals[i]->bv_len > sizeof(buf) - 1) {
  26. + char *buf;
  27. +
  28. + buf = malloc(vals[i]->bv_len + 1);
  29. + if (buf == NULL) {
  30. krb5_set_error_string(context, "malloc: out of memory");
  31. ret = ENOMEM;
  32. goto out;
  33. @@ -998,6 +1000,7 @@
  34. memcpy(buf, vals[i]->bv_val, vals[i]->bv_len);
  35. buf[vals[i]->bv_len] = '\0';
  36. ent->entry.etypes->val[i] = atoi(buf);
  37. + free(buf);
  38. }
  39. ldap_value_free_len(vals);
  40. }