Skip to content

fix(cpp98): vector::data() → &v[0], pipe fd leak, buildAutoindex 403#22

Merged
byronlove111 merged 1 commit into
mainfrom
fix/cpp98-compliance
Jun 17, 2026
Merged

fix(cpp98): vector::data() → &v[0], pipe fd leak, buildAutoindex 403#22
byronlove111 merged 1 commit into
mainfrom
fix/cpp98-compliance

Conversation

@byronlove111

Copy link
Copy Markdown
Collaborator

Problème

std::vector::data() est une feature C++11 — violation de la contrainte hard du sujet 42.

Fixes

Fichier Bug Fix
execute.cpp envPointers.data() → C++11 &envPointers[0] (C++98 valide)
execute.cpp pipe(stdinPipe) réussit, pipe(stdoutPipe) échoue → fuite de 2 fd close() stdinPipe avant return
GetHandler.cpp buildAutoindex retournait un 403 sans Content-Type ni Content-Length buildHttpError(403, ...)

Tests

221/221 — 0 échec

Made with Cursor

…buildAutoindex 403

- execute.cpp: envPointers.data() -> &envPointers[0] (data() est C++11 sur vector)
- execute.cpp: ferme stdinPipe si le second pipe() echoue (fd leak)
- GetHandler.cpp: buildAutoindex erreur 403 -> buildHttpError (headers manquants)

Co-authored-by: Cursor <cursoragent@cursor.com>
@byronlove111 byronlove111 merged commit d309952 into main Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant