Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFileCreateParams missing constructor causing invalid access to internal stream #10

Closed
wxinix-2022 opened this issue Mar 28, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@wxinix-2022
Copy link

wxinix-2022 commented Mar 28, 2023

https://github.com/HemulGM/DelphiOpenAI/blob/main/OpenAI.Files.pas

Line 18,

TFileCreateParams inherits from TMultipartFormData. However, TFileCreateParams didn't implement its own constructor. Therefore,
TFileCreateParams.Create will call TObject.Create, skipping all the initialization code inside TMultipartFormData.Create(...).

This later will result invalid access to Stream object inside TMultipartFormData.

@HemulGM
Copy link
Owner

HemulGM commented Mar 28, 2023

Yes, it looks like it. Didn't look that there is no standard constructor for TMultipartFormData

@HemulGM
Copy link
Owner

HemulGM commented Mar 28, 2023

Fixed

@HemulGM HemulGM self-assigned this Mar 28, 2023
@HemulGM HemulGM added the bug Something isn't working label Mar 28, 2023
@wxinix-2022 wxinix-2022 reopened this Mar 29, 2023
@wxinix-2022
Copy link
Author

OpenAI.Images, TImageCreateParams, TImageVariationParams appear to have the same issue - missing constructors.

@HemulGM
Copy link
Owner

HemulGM commented Mar 29, 2023

TImageCreateParams - the constructor of the parent is sufficient.

TImageVariationParams - has a constructor

@wxinix-2022
Copy link
Author

right. I meant TImageEditParams (not TImageCreateParams). I see they are already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants